🤖 fix: reveal tail plans in hyper density#3420
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed3b4a47f7
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ed3b4a4 to
12b6381
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12b63810d3
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
12b6381 to
0d4d109
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
0d4d109 to
9853b3d
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
9853b3d to
0bb7bd1
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
0bb7bd1 to
c90836c
Compare
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Reveal the final
propose_plantool call in hyper transcript density by default-expanding only the work and operational bundles that contain the tail plan.Background
In hyper density, settled work and operational bundles can hide tool rows before
ProposePlanToolCallrenders. That made an agent pause afterpropose_planlook like no actionable plan was visible. The requested behavior is scoped to the last displayed tool call, not the latest plan anywhere in history.Implementation
propose_plan.image_generate/image_edittool rows.Validation
bun test ./tests/ui/chat/transcriptDensity.test.tsTEST_INTEGRATION=1 bun x jest tests/ui/chat/transcriptDensity.test.ts --runInBandmake static-checkmake storybook-buildagent-browseragainstHyperTailProposePlanExpanded; captured screenshot/video artifacts underdogfood-output/ui-density-tail-plan/and verified no browser errors.Risks
Low-to-medium: the change touches transcript render projection consumption in
ChatPane, but the default expansion is keyed to the exact tail plan's containing bundles and does not persist state changes.📋 Implementation Plan
Plan: reveal tail
propose_planin hyper transcript densityGoal
When transcript density is
hyper, apropose_plantool call should be immediately visible when it is the last tool call in the displayed transcript, so the user can see why the agent paused. This must not globally expand old/historicalpropose_plancalls; if any later tool call exists, the older plan should stay collapsed under the normal hyper-density rules.Evidence gathered
ChatPane.tsxowns transcript density, hyper bundle projection, expansion overrides, and per-row hide/show decisions.computeWorkBundleInfos(deferredMessages);computeOperationalBundleInfos(deferredMessages, ...).MessageRenderercan render the tool component.ProposePlanToolCallalready usesuseToolExpansion(true), so the missing UI is caused by parent bundle hiding, not by the plan component itself being collapsed.ChatPane.tsxalready computes a latestpropose_planid forisLatestProposePlan, but that means “latest plan anywhere”; the requested behavior is based on the last tool call, so this should remain separate.tests/ui/chat/transcriptDensity.test.tsandsrc/browser/features/Messages/TranscriptDensity.stories.tsx; plan mocks are available viacreateProposePlanToolinsrc/browser/stories/mocks/tools.ts.Recommended approach
Approach A — ChatPane-owned tail-plan forced expansion
ChatPane.tsxunless implementation needs a tiny pure helper for readability.deferredMessagesfor tail-tool detection because it is the same message snapshot used by hyper bundle projections and rendering.Alternative considered
Extracting a reusable helper into
transcriptRenderProjection.tswould make the tail-tool detection easier to unit test in isolation, but it likely raises product-code LoC to +35 to +60 LoC without much benefit because the actual bug is inChatPane's render-time interaction between work and operational bundles. Use this only if the local helper becomes awkward.Implementation steps
Compute the last displayed tool call
ChatPane.tsx, scandeferredMessagesfrom the end formessage.type === "tool".tailProposePlanToolIdonly whentranscriptDensity === "hyper"and that last tool hastoolName === "propose_plan".latestProposePlanIdlogic unchanged forProposePlanToolCallfreshness/actions.Force-expand only bundles containing the tail plan
bundleContainsMessageId(bundle, tailProposePlanToolId).tailProposePlanToolId, compute:isWorkBundleExpanded = forceRevealTailPlan || (override ?? workBundle.defaultExpanded).tailProposePlanToolId, compute:isOperationalBundleExpanded = forceRevealTailPlan || (override ?? operationalBundle.defaultExpanded).Preserve expected non-plan behavior
Tests
Update
tests/ui/chat/transcriptDensity.test.tscreateProposePlanTool.propose_planas the last tool call.propose_planis followed by another tool call.Add Storybook visual coverage in
src/browser/features/Messages/TranscriptDensity.stories.tsxHyperTailProposePlanExpandedstory that sets density tohyperand ends withcreateProposePlanTool(...).STABLE_TIMESTAMP.Optional pure-helper tests
transcriptRenderProjection.ts, add focused tests insrc/browser/utils/messages/transcriptRenderProjection.test.tsfor “last tool is plan” vs “later non-plan tool exists”.Acceptance criteria
propose_plan, the plan tool UI is visible without manually expanding any transcript bundle.propose_plancalls do not auto-expand when a later tool call exists.ProposePlanToolCallremain unchanged.Validation and quality gates
Run after implementation:
bun test tests/ui/chat/transcriptDensity.test.tstranscriptRenderProjection.tsis touched:bun test src/browser/utils/messages/transcriptRenderProjection.test.tsmake static-checkmake storybook-buildProceed to the next phase only after the relevant gate passes; fix failures before moving on.
Dogfooding plan
Skill guidance applied: read
dogfood,agent-browser,dev-server-sandbox,dogfood/references/issue-taxonomy.md, and currentagent-browser skills get coreguidance. Use directagent-browsercommands, notnpx; use snapshots for refs; re-snapshot after page changes; collect screenshots/videos as evidence; check console/errors; and run isolated app instances with a temporaryMUX_ROOTviamake dev-server-sandbox.Start an isolated Mux dev surface
make dev-server-sandbox DEV_SERVER_SANDBOX_ARGS="--clean-projects"so dogfooding uses a fresh temporaryMUX_ROOT, free backend/Vite ports, copied provider config if present, no copied projects, and no collision with the user’s real app state.agent-browser skills get core.Initialize browser evidence capture
./dogfood-output/ui-density-tail-plan/withscreenshots/andvideos/subdirectories.agent-browser --session ui-density-tail-plan open <VITE_URL>followed byagent-browser --session ui-density-tail-plan wait --load networkidle.agent-browser --session ui-density-tail-plan screenshot --annotate ./dogfood-output/ui-density-tail-plan/screenshots/initial.pngagent-browser --session ui-density-tail-plan snapshot -iPositive behavior check: tail
propose_planis visibleHyperTailProposePlanExpandedStorybook story if the fixture is implemented there, or load the equivalent seeded app state in the sandbox.agent-browser --session ui-density-tail-plan record start ./dogfood-output/ui-density-tail-plan/videos/tail-plan-visible.webm.propose_plantool UI without manually clicking work/operational bundle rows.agent-browser --session ui-density-tail-plan errorsandagent-browser --session ui-density-tail-plan console.Negative behavior check: historical plan stays collapsed
propose_planis followed by a later non-plan tool call.Focused exploratory pass around the changed surface
Wrap up dogfood artifacts
agent-browser --session ui-density-tail-plan close.KEEP_SANDBOX=1was used for debugging, note the sandbox root; otherwise let the temporaryMUX_ROOTclean up on exit.Review focus
Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:$39.77