Skip to content

fix(actor): emit metadata before resolveModelRef to preserve failed subtask state#1273

Open
MiMoHardFather wants to merge 1 commit into
mainfrom
fix/actor-metadata-before-resolve
Open

fix(actor): emit metadata before resolveModelRef to preserve failed subtask state#1273
MiMoHardFather wants to merge 1 commit into
mainfrom
fix/actor-metadata-before-resolve

Conversation

@MiMoHardFather

Copy link
Copy Markdown
Collaborator

Summary

  • Emit actor tool metadata (sessionId, model) before resolveModelRef so that when model resolution fails, the failed tool state remains navigable in the TUI
  • Update MCP lifecycle test to reflect auto-connect behavior
  • Move cache_control to tool_use/tool_result blocks in LLM stream test

Problem

When resolveModelRef fails (e.g. unknown model referenced), the tool execution short-circuits before onReady fires, leaving the failed subtask tool state without metadata. This breaks TUI navigation into the failed subtask.

Fix

Parse the model reference into a fallback model and emit metadata early. If resolveModelRef subsequently succeeds, the model is still correct; if it fails, the metadata is already set and the error state is navigable.

…ubtask state

When resolveModelRef fails (e.g. unknown model), the tool state was left
without sessionId/model metadata, breaking TUI navigation into the failed
subtask. Emit metadata early with a parsed fallback model so the error
state is always navigable.

Also updates tests: MCP lifecycle test for auto-connect behavior, and
moves cache_control to tool_use/tool_result blocks in LLM stream test.
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.

1 participant