fix: add result param to attemptCompletion and remove GeneratingRunResult#577
Merged
fix: add result param to attemptCompletion and remove GeneratingRunResult#577
Conversation
…pletion path
- Change attemptCompletion inputSchema to z.object({}).strict() producing
additionalProperties: false, preventing LLMs from passing args
- Remove extractTextFromLastMessage shortcut in CallingMcpTools; always
transition to GeneratingRunResult for final text generation
- Revert "OK" fallback text in GeneratingRunResult
- Update E2E expert instructions to simple "Call attemptCompletion"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…letion The terse "Call attemptCompletion" instruction caused LLMs to complete without generating visible summary/description text, resulting in empty completeRun text. Updated to explicitly request content generation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mpty
When the LLM generates result text alongside the attemptCompletion tool
call, the follow-up LLM call in GeneratingRunResult (with tools:{}) often
returns empty text since the LLM has nothing more to add. Fall back to
extracting text from the last expert message in the checkpoint.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sult Add optional `result` string parameter to attemptCompletion so the LLM provides its final response directly in the tool call, eliminating the extra LLM round-trip in GeneratingRunResult that was unreliable (often returning empty text) and wasteful. - Add `result?: string` to attemptCompletion inputSchema - Complete runs directly from CallingMcpTools (no GeneratingRunResult) - Remove GeneratingRunResult state, attemptCompletion event type - Remove dead attemptCompletion event handling in React utils - Update system prompt and E2E instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n-strict-schema # Conflicts: # packages/runtime/src/state-machine/states/calling-mcp-tools.ts # packages/runtime/src/state-machine/states/generating-run-result.ts
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.
Summary
resultstring parameter toattemptCompletiontool so the LLM provides its final response directly in the tool callCallingMcpToolsstate, eliminating the extra LLM round-trip inGeneratingRunResultthat was unreliable (often returning empty text for multi-modal tasks) and wastefulGeneratingRunResultstate,attemptCompletionevent type, and dead React event handling coderesultparameterTest plan
pnpm typecheck— 23/23 packages passpnpm test— 1090/1090 unit tests passpnpm build— 23/23 packages buildpnpm format-and-lint— no new warningspnpm test:e2e— 76/76 E2E tests pass (including PDF and image multi-modal tests)🤖 Generated with Claude Code