Skip to content

feat(tui): match main model metadata in child sessions - #50798

Open
guanbear wants to merge 13 commits into
anomalyco:devfrom
guanbear:fix/v2-subagent-model-variant-tab
Open

guanbear wants to merge 13 commits into
anomalyco:devfrom
guanbear:fix/v2-subagent-model-variant-tab

Conversation

@guanbear

@guanbear guanbear commented Sep 23, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #50795

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

After opening a subagent's child session, show its persisted model and variant in the composer footer. Reuse the main prompt's PromptMetadataRow and the model/provider catalog at the child's location. Default variants are omitted; unavailable models use their persisted ID; children without a model do not borrow the parent's model. Subagents list rows are unchanged.

Synced with dev at c11a32ff1 (V2 2.1.4) on 2026-10-27. The implementation and tests remain limited to two files. This uses the V2 composer path; #38772 targeted the legacy V1 footer. I would appreciate confirmation of the footer placement and design.

How did you verify your code works?

Validation on 2026-10-27 with Bun 1.4.4:

  • Full packages/tui suite (bun run test): 1,559 passed, 2 skipped, 0 failed, across 186 files.
  • Focused composer file: 15 passed, then 150 passed with --rerun-each 10.
  • Added direct regressions for a child without a model despite a configured parent model, an unavailable child model, and navigation between distinct child models and back to the parent. Existing coverage includes default variants, missing agents and 80/40-column layouts.
  • Repository bun run check: lint and all 35 package typecheck tasks passed. packages/tui official bun run typecheck:tsc also passed.
  • Real CLI/TUI connected to an isolated local server, driven through Terminal Control. Created persisted parent/child sessions through the public API, opened a child from the picker and checked known/unavailable models, high, default variants and 80/40-column rendering. These are API-created demo sessions; no external model request or live agent delegation was performed.

Screenshots / recordings

Current real-server TUI captures (2026-10-27):

Opened child with its own model and high, 80 columns:

Opened child model and effort

Default variant omitted; shared metadata layout condenses at 40 columns:

Child model at 40 columns

Unavailable model uses the child's persisted ID:

Unavailable child model

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none">
  <style>@media(prefers-reduced-motion:no-preference){.effort{animation:pulse 3s ease-in-out infinite}@keyframes pulse{0%,100%{opacity:.5}50%{opacity:1}}}</style>
  <rect x="1" y="1" width="238" height="70" rx="6" stroke="currentColor" opacity=".25"/>
  <text x="12" y="23" fill="currentColor" font-size="11" font-family="monospace" opacity=".65">Opened child session</text>
  <path d="M12 34H228" stroke="currentColor" opacity=".2"/>
  <text x="12" y="54" fill="currentColor" font-size="11" font-family="monospace">Subagent · Model</text>
  <text class="effort" x="172" y="54" fill="currentColor" font-size="11" font-family="monospace">· high</text>
</svg>

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Sep 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

guanbear added a commit to guanbear/opencode that referenced this pull request Sep 29, 2026
guanbear added a commit to guanbear/opencode that referenced this pull request Sep 29, 2026
guanbear added a commit to guanbear/opencode that referenced this pull request Sep 29, 2026
@guanbear

guanbear commented Sep 29, 2026 •

Copy link
Copy Markdown
Author

Update: I updated the branch against current v2 (a604b7f7; PR head 256e28cb2) and reused the main prompt's PromptMetadataRow in the opened child session. The Subagents list remains unchanged. I added focused tests for normal, missing-agent, and default-variant cases; the final v2 TUI suite passed (425 tests), as did package typecheck and the repository pre-push lint/typecheck. The PR now has refreshed 80- and 40-column captures of the production component with fixture data.

I also noted #51232, which proposes showing the model in the list, and #38772 on dev. This PR follows #50795's opened-child footer behavior. I would appreciate guidance on the preferred placement and merge path. Thank you.

guanbear added a commit to guanbear/opencode that referenced this pull request Sep 29, 2026
guanbear added a commit to guanbear/opencode that referenced this pull request Sep 29, 2026
guanbear added a commit to guanbear/opencode that referenced this pull request Sep 29, 2026
@guanbear guanbear changed the title feat(tui): show effective subagent model and variant in v2 tab feat(tui): show child model in v2 session footer Sep 29, 2026
guanbear added a commit to guanbear/opencode that referenced this pull request Sep 29, 2026
guanbear added a commit to guanbear/opencode that referenced this pull request Sep 29, 2026
@guanbear guanbear changed the title feat(tui): show child model in v2 session footer feat(tui): match main model metadata in child sessions Sep 29, 2026
@guanbear

guanbear commented Oct 8, 2026

Copy link
Copy Markdown
Author

Thanks for taking a look. I have updated this PR against v2 93afa9190 (2.0.24) and resolved the composer/keymap changes while keeping the new terminal settings and keyed session navigation.

The opened child session uses the same PromptMetadataRow as the main prompt, reading the child's persisted model and variant. There is no parent-model guess when the child has no model.

Verification: 432 TUI tests passed, TUI typecheck passed, and bun run check plus the required pre-push checks passed. I also refreshed the 80/40-column screenshots in the PR body; these render the production component with fixture data, not a live delegated run.

@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:15
@guanbear

Copy link
Copy Markdown
Author

Thanks for retargeting this to dev. I have now synced the branch with current dev (63c1a27af, V2 2.0.32) and corrected the description to reflect the V2 promotion. This PR already uses the V2 opened-child Composer, so the legacy V1 closure of #38772 does not require a separate port here.

The scope remains two files: reuse the main prompt's PromptMetadataRow for the child's persisted model/variant, plus the focused coverage; the Subagents list stays unchanged. The TUI suite passes all 436 tests, and bun run check passes lint plus all 34 package typechecks. The screenshot dates and fixture-data limitations remain explicit in the description.

Could you please confirm whether this footer placement fits the intended design and review the implementation when convenient? Thank you.

@guanbear

Copy link
Copy Markdown
Author

One additional demand signal: #57366 independently requests the same opened-child-session bottom-bar model and reasoning-effort display. The triage bot linked it to #50795 and this PR. The TUI portion is covered by this implementation; the Desktop mention would need separate confirmation.

All four checks on the current head are now passing. The scope remains the shared main-prompt metadata presentation in the opened child session. I would appreciate confirmation of the footer placement and a review when convenient. Thank you!

@guanbear

Copy link
Copy Markdown
Author

Synced this with current dev (c11a32ff1, V2 2.1.4) and added regressions for missing/unavailable child models and switching between children and back to the parent. The implementation still reuses the main prompt's metadata row and is limited to the composer and its tests.

The full TUI suite passes (1,559 passed, 2 skipped), along with repository lint/typechecks and the official TUI TypeScript check. I also replaced the fixture-only screenshots with real TUI captures against an isolated server using API-created demo sessions; the description notes that no external model/delegation run was involved.

When you have time, could you confirm whether this footer placement fits the intended V2 design? Happy to adjust it. Thank you for reviewing!

This branch has not been deployed

No deployments
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.

tui(v2): opened subagent session hides effective model in footer

1 participant