getappmap / getappmap/appmap-js

Retry on Sonnet error "Output blocked by content filtering policy"

Open
#2,006 2 comments 0 reactions 2 assignees View on GitHub

@dustinbyrne is already working on this.

Since Sep 20, 2024.

bug navie-plan
Dominant language
TypeScript
Stars
53
Forks
18
Avg merge
3d 18h
Merged PRs (30d)
8

Description

Error example:

Handling exception: Error: Failed to complete: SSE Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output blocked by content filtering policy"}             }
    at AnthropicCompletionService.complete (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/navie/dist/services/anthropic-completion-service.js:167:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExplainCommand.execute (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/navie/dist/commands/explain-command.js:108:26)
    at async Navie.execute (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/navie/dist/navie.js:161:30)
    at async LocalNavie.ask (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/cli/built/rpc/explain/navie/navie-local.js:135:85)
    at async Explain.explain (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/cli/built/rpc/explain/explain.js:78:9) {
  [cause]: APIConnectionError: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output blocked by content filtering policy"}             }
      at APIError.generate (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/node_modules/@anthropic-ai/sdk/error.js:37:20)
      at Stream.iterator (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/node_modules/@anthropic-ai/sdk/streaming.js:52:48)
      ... 3 lines matching cause stack trace ...
      at async Object.pull (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/node_modules/@langchain/core/dist/utils/stream.cjs:98:41) {
    status: undefined,
    headers: undefined,
    request_id: undefined,
    error: undefined,
    cause: Error: SSE Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output blocked by content filtering policy"}             }
        at castToError (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/node_modules/@anthropic-ai/sdk/core.js:709:12)
        at APIError.generate (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/node_modules/@anthropic-ai/sdk/error.js:37:84)
        at Stream.iterator (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/node_modules/@anthropic-ai/sdk/streaming.js:52:48)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async ChatAnthropic._streamResponseChunks (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/node_modules/@langchain/anthropic/dist/chat_models.cjs:677:26)
        at async ChatAnthropic._streamIterator (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/node_modules/@langchain/core/dist/language_models/chat_models.cjs:92:34)
        at async Object.pull (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/node_modules/@langchain/core/dist/utils/stream.cjs:98:41)
  }
}
Stack trace: Error: Failed to complete: SSE Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output blocked by content filtering policy"}             }
    at AnthropicCompletionService.complete (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/navie/dist/services/anthropic-completion-service.js:167:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExplainCommand.execute (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/navie/dist/commands/explain-command.js:108:26)
    at async Navie.execute (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/navie/dist/navie.js:161:30)
    at async LocalNavie.ask (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/cli/built/rpc/explain/navie/navie-local.js:135:85)
    at async Explain.explain (/home/runner/work/navie-benchmark/navie-benchmark/submodules/appmap-js/packages/cli/built/rpc/explain/explain.js:78:9)
Cause: Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output blocked by content filtering policy"}             }

https://support.anthropic.com/en/articles/9205721-why-am-i-receiving-an-output-blocked-by-content-filtering-policy-error

--

Plan changes for the navie package only. Do not propose changes to the client package.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.