Repository navigation
fix(mecatui): settle concurrent tool cards promptly - #1977
Merged
Merged
Conversation
Co-authored-by: Mecatl <noreply@mecatl.dev>
Co-authored-by: Mecatl <noreply@mecatl.dev>
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
tool.resultauthoritative, and retain the newest genuinely pending tool in the running footer.Regression details
The card-header state split predates typed scrollback: from the first inline Subagent UI,
subagent.enddrove the terminal body while only the outertool.resultchanged the header from…to✓/✗. Historically those events were adjacent because each read-batch goroutine finalized and emitted its own result before the batch-level wait, so the mismatch was rarely visible.Commit
409ea74e8(feat: integrate contextual guardrails into execution and approvals) changed successful read-only execution to produce private records, wait for every sibling withwg.Wait(), and only then finalize results in call order. A fast foreground Subagent still emitssubagent.endfrom inside its tool execution, but its outer result can now remain withheld behind a slow sibling for an arbitrarily long interval. That timing regression exposed the pre-existing Mecatui state bug.The typed-scrollback extraction in
e7e51c90bpreserved the state split; it did not introduce the regression. This PR uses existing Subagent/Team/Parallel terminal projections to settle presentation during the newly long interval while retaining the later canonical result as authoritative. Generic read-only tools have no equivalent early lifecycle event and remain tracked by #1976.Development stage
Contract linkage
Interface conformance
Issue relationship
Relates to #1976
Type of change
Test plan
Baseline checks
task lint)task test) — all relevant suites passed; the aggregate remains red on the unrelated existing ownership assertion atenvironment/microvm/repository_attachment_test.go:510, reproduced independentlytask test:race)go run ./cmd/mecademo)task docs)task site:build)task api:check)task api:update+engine/CHANGELOG.mdtask ac-trace-strict)/panel-reviewAdditional focused verification:
go test ./cmd/mecatui/ui ./cmd/mecatui/ui/internal/scrollback -count=1task test:goldenChanges
cmd/mecatui/ui/tool_block.gocmd/mecatui/ui/internal/scrollback/tool.gocmd/mecatui/ui/update.gocmd/mecatui/ui/conversation.gocmd/mecatui/ui/concurrent_tool_completion_test.goUser-facing change
A completed fast Subagent or Parallel card now immediately shows
✓or✗while a slower concurrent sibling continues running. The footer continues naming the remaining active sibling.Special notes for reviewers
This deliberately does not change engine result timing. Generic read-only results are still retained behind the concurrent batch barrier; #1976 tracks the Bounded follow-up and acceptance plan.