fix(web-ui): tolerate missing model identity in model-round events - #1936
Merged
Merged
Conversation
The ACP client emitter builds agentic://model-round-started payloads by hand and does not carry modelConfigId/effectiveModelName, which the native projection always provides. Since 4d73585 the UI treated these fields as required and called .trim() unconditionally, so external ACP agent rounds threw on start, no ModelRound was created, and subsequent text-chunk/tool events were dropped - leaving the transcript empty while the agent kept working. Make both fields optional on the event contracts and omit them from the round when absent instead of fabricating placeholder values. The subagent parent task model update now reads from the created round and only runs when a model name exists.
guantw
force-pushed
the
fix/acp-agent-model-round-streaming
branch
from
July 31, 2026 13:39
0c22aaf to
ef0aa08
Compare
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
When BitFun runs as an ACP client chatting with an external ACP agent (Codex, Claude Code, etc.), the FlowChat transcript stays empty: the agent keeps running, permission prompts may appear, files may be modified, but assistant text / tool results never show up.
Root cause
Since commit 4d73585 ("feat(agentic): support configurable subagent models"),
handleModelRoundStartinEventHandlerModule.tstreatsmodelConfigIdandeffectiveModelNameas required and calls.trim()on them unconditionally. The nativeAgenticEvent::ModelRoundStartedprojection always carries both fields, but the ACP client emitter (acp_client_api.rs) builds theagentic://model-round-startedpayload by hand and does not include them.Failure chain:
.trim()onundefinedthrows a TypeError.ModelRoundis created for that round.agentic://text-chunk/ tool events look up the round viaaddModelRoundItemand are dropped ("Model round not found").Fix
modelConfigId/effectiveModelNameoptional onModelRoundStartedEventandModelRoundCompletedEvent(AgentAPI.ts).ModelRoundwhen absent instead of fabricating placeholder values (external ACP agents have no BitFun model identity).updateSubagentParentTaskModelreads from the created round and only runs when a model name is present.Verification
pnpm --dir src/web-ui run test:run src/flow_chat/services/flow-chat-manager/EventHandlerModule.test.ts- 25/25 passedpnpm run type-check:web- passed