Repository navigation
Conversation
The pinned Claude harness replaces a function result without an image or visible text with its own placeholder (for example "Unknown error"), and it trims joined error text. The exact receipt check failed the Turn with execution_failed for those results. Blank results are now confirmed by their native outcome, and error text is compared after the same trim; other results keep exact matching. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sults The adapter README now states that a blank result is confirmed by its native outcome and that error text is compared after the native join and trim. The OpenAI compatibility ledger records the model-visible placeholder and trimmed error text, with the Chinese mirror and source hash updated. The unit test also covers whitespace-only errors and leading whitespace in error text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RGB-loop
marked this pull request as ready for review
October 18, 2026 09:37
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RGB-loop
marked this pull request as draft
October 18, 2026 13:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RGB-loop
marked this pull request as ready for review
October 18, 2026 14:01
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RGB-loop
marked this pull request as draft
October 19, 2026 12:55
…nction-result # Conflicts: # contracts/agents-api/zh/index.md # packages/claude-sdk-adapter/README.md # packages/claude-sdk-adapter/tests/function_bridge.test.mjs
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The public contract lets a function result omit
outputanderroror set them to null (contracts/agents-api/execution-tools.md). Core admits{"success":true,"output":""},"output":[]and"error":"", and maps them to empty function result content. With the Claude Harness, those results fail the whole Turn withexecution_failed.The pinned native harness (
@anthropic-ai/claude-agent-sdk0.3.269) does not record a blank tool result as submitted:tool_resultcontent[]/""/ whitespace only(mcp__functions__<name> completed with no output)[]Unknown error""Command failed with no output"x"+"", or"boom\n"x,boom)FunctionBridge.consumerequires the native block to equal the submitted content, so it throwsNative function response differs from submitted result.although the native harness did apply the result.Change
Adapter code only; Core admission and the public contract are unchanged.
tool_resultwith the sameis_error. The native harness owns how it renders a blank result.join("\n").trim()the native formatter applies.is_errormismatch still fails.packages/claude-sdk-adapter/README.md(the bridge's owning doc) states both receipt rules.contracts/agents-api/index.md, with thezh/mirror andsource_hash) records the model-visible difference: Claude Code shows its own placeholder for a blank result and trims error text.Semantics and alternatives (CONTRIBUTING: raise semantics with a recommendation)
Validation
packages/claude-sdk-adapter:pnpm typecheckpasses.pnpm testpasses (build plus all adapter tests).function_bridge.test.mjscase covers six blank results (including a whitespace-only error) with the captured native strings. For each, a flippedis_erroris rejected. It also covers trimmed error text (trailing empty part, trailing newline, leading space, leading empty part, empty part in the middle), and checks that non-blank success and error mismatches still throw.make check-namespasses.git diff --checkis clean.zh/index.mdsource_hashmatches the new English ledger. Checked with an offline subset ofwebsite/tests/translations.test.mjs(source, hash, fences, list items, inline literals); the full website test was not run because its dependencies were not installed locally.dist/main.js) with its pinned native SDK binary (linux-x64), against a local fake Anthropic Messages API on 127.0.0.1, with a temporary HOME/cwd and a fake key.execution_failedbefore this change; after it, all 13 emitfunction_appliedand reachresult.mainand found no blocking issues, as AGENTS.md asks.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.