Skip to content

fix: restore final_output_tool when agent is recreated after LRU eviction - #10793

Merged
alexhancock merged 1 commit into
aaif-goose:mainfrom
Abhijay007:fix/recipe-final-output-tool-lost-on-lru-eviction
Aug 4, 2026
Merged

fix: restore final_output_tool when agent is recreated after LRU eviction#10793
alexhancock merged 1 commit into
aaif-goose:mainfrom
Abhijay007:fix/recipe-final-output-tool-lost-on-lru-eviction

Conversation

@Abhijay007

Copy link
Copy Markdown
Collaborator

Fixes #10784

Summary

Restores final_output_tool when an agent is recreated after being evicted from the LRU cache in create_agent_locked. Previously, only MCP extensions were reloaded, the recipe's response schema was silently dropped, so the recipe__final_output tool never appeared in requests sent to the model.

Testing

manaul and unit

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b853a8bc97

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +226 to +229
if let Some(recipe) = &session.recipe {
agent
.apply_recipe_components(recipe.response.clone(), true)
.await;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Render recipe parameters before restoring response schema

This restores the final-output tool from the raw session.recipe.response, but ACP recipe sessions persist the original template recipe and store the selected values separately (new_session.rs stores recipe and user_recipe_values; apply_session_recipe later re-renders before applying). If a valid schema templates a field name such as "{{ output_field }}", any AgentManager-only restore path after eviction advertises and validates the literal placeholder schema instead of the user's rendered schema, forcing the model to return the wrong JSON shape. Please render the stored recipe with session.user_recipe_values before installing the final output tool.

Useful? React with 👍 / 👎.

@alexhancock alexhancock self-assigned this Jul 30, 2026
@alexhancock
alexhancock merged commit b4dd5fb into aaif-goose:main Aug 4, 2026
24 checks passed
alexhancock added a commit that referenced this pull request Aug 4, 2026
* origin/main: (58 commits)
  Handle MCP tool list change notifications
  fix: restore final_output_tool when agent is recreated after LRU eviction (#10793)
  feat(ui): bring back make sidebar resizable with drag handle and persisted width (#10795)
  docs: document auto-injected GOOSE_SHELL flags (#10759)
  feat: surface output-token-limit info (#10831)
  fix(desktop): avoid O(n²) cloning during session load (#10665)
  feat: add interactive menu for single select elicitations (#10327)
  fix(acp): prefix child stderr log target so it passes the default goose=info filter (#10901)
  chore (codex-acp): migrate to @agentclientprotocol/codex-acp (#10923)
  style: add dark mode inline code styling for message bubbles (#10861)
  docs: clarify macOS sandbox feature was removed in post-v1.25.0 cleanup (#10900)
  fall back to static model list only for non-models payloads (#10189)
  Remove CLI project support (#10838)
  fix(anthropic): add claude-sonnet-5 and claude-fable-5 to known models list (#10865)
  fix: stdio extensions silently skipped when name missing or env: used in config (#10773)
  feat(desktop): show session metadata on sidebar chat hover (#10663)
  fix(serve): start scheduler at startup instead of first ACP connection (#10766)
  fix: respect disabled builtin extensions (developer) at session start (#10223)
  fix: parse PyPI requirements for OSV checks (#10510)
  fix(telegram): contain voice file extensions (#10456)
  ...

# Conflicts:
#	Cargo.lock
#	crates/goose/src/agents/extension_manager.rs
#	crates/goose/tests/mcp_replays/npx-y@modelcontextprotocol_server-everything@2026.1.14
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.

response.json_schema structured output silently fails against custom OpenAI-compatible (local model) providers

2 participants