Skip to content

[PR] fix: preserve Google thinking budgets after tool errors - #7185

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-18_preserve-failed-tool-effort
Nov 20, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-18_preserve-failed-tool-effort

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Fixes #7183.

Problem

With output steering enabled, a Google function response containing an explicit error is classified as a clean mechanical continuation. The actual HTTP forwarder reduces thinkingBudget: 8000 to 128 even after a permission failure or partial tool failure, instead of preserving the budget requested for recovery.

Change

Carry the presence of an own top-level functionResponse.response.error field into the existing structural isError flag. The kernel already keeps effort unchanged for that flag. This follows the Google FunctionResponse error carrier.

An explicit error carrier preserves the requested budget, including null/false values; this is a conservative clean-result rule. An error key nested in ordinary output data remains ordinary output. A successful parallel result cannot conceal another tool's error.

The production change is confined to the Google adapter. Existing configuration, kernel code, and verbosity directives are unchanged.

Validation

  • Reproduced on current master 3f0c1d21, with this worktree's rebuilt acp-kernel 0.0.199 and pi-subagents 0.2.4.
  • Baseline steering run: 45 passed / 9 failed. All 35 prior tests pass; seven new error-carrier cases fail, as does the HTTP failure assertion (reported at both child and parent levels).
  • After the change: 104 targeted tests pass across the new Google-error suite, existing steering, effort/cache attribution, and compression settings.
  • Sixteen direct cases cover both string and parsed-object entry points, successful/nested-output controls, parallel results, disabled settings, dynamic budgets, and the existing floor. The real HTTP pair observes clean → 128, error → 8000 at the supplier and retains the tool result.
  • npm run typecheck, npm run build, npm run check:test-import-graph, and git diff --check pass.
  • Real-model Codex preflight cannot reach the local upstream on port 8199. The required four-phase run remains unrun and is a pre-merge validation item; a skipped remote lane does not satisfy it.

Audited 267 fork heads and 22 upstream file-history commits. All three historical file versions retain the same Google normalizer; the older #1096 classifier and #1257 normalizer also omit this error signal.

…7183)

Carry explicit function-response errors into the existing structural classifier. Keep clean-result effort routing and the requested error-recovery budget distinct.
@ranxianglei ranxianglei changed the title fix: preserve Google thinking budgets after tool errors [PR] fix: preserve Google thinking budgets after tool errors Nov 18, 2026
@ranxianglei
ranxianglei merged commit 48cec0e into ranxianglei:master Nov 20, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google tool errors trigger mechanical thinking-budget reduction

2 participants