Repository navigation
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
The label change works: with a custom work-item agent the ribbon showed Work-Item on the base and shows work-item with this PR, and built-in agents keep their names (Build, Plan…). I checked this by running both checkouts from source with opencode-drive. bun run typecheck in packages/tui passes.
This can't be merged yet because it breaks 28 tests in packages/tui. bun test there gives 30 failures with this PR and 2 on the base; the 2 are the same shell-output timeouts in both. The fake /api/agent replies in test/app-lifecycle.test.tsx, test/session-panel.test.tsx, test/new-session-id.test.tsx and test/prompt-shell-failure.test.tsx send { id: "build", … } with no name. Now that the label reads agent.name, it is empty there, the ribbon doesn't show, and the tests time out waiting for Demo Model. Adding name: "Build" to those fixtures (11 lines) makes all four files pass again, and they belong in this PR.
A design point for maintainers: #57722 was answered as a deliberate choice, because the TUI titlecases agent ids in many other places (the user message header, "Switched agent from … to …", subagent titles, the mini footer). With only the ribbon changed, a custom agent shows as work-item in the ribbon but Work-Item in the transcript right above it.
Public API: unchanged.
Related: #30372
| const model = local.model.parsed() | ||
| return { | ||
| agentLabel: agent ? Locale.titlecase(agent.id) : undefined, | ||
| agentLabel: agent ? agent.name : undefined, |
There was a problem hiding this comment.
This breaks 28 tests in packages/tui. Their fake /api/agent replies leave out name ({ id: "build", mode: "primary", hidden: false, permissions: [] } in test/app-lifecycle.test.tsx, test/session-panel.test.tsx, test/new-session-id.test.tsx, test/prompt-shell-failure.test.tsx), so agentLabel is now undefined, the ribbon doesn't show, and the tests time out waiting for Demo Model. Agent.Info requires name, so the right fix is to add name: "Build" to those fixtures rather than to fall back to the id here. With that change all four files pass locally.
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 72-hour window. Feel free to open a new pull request that follows our guidelines. |


Issue for this PR
Closes #57722
Type of change
What does this PR do?
The prompt ribbon titlecased the agent id, so a custom agent
work-itemwas shown asWork-Item. The label did not match the identifier users configure and reference.packages/tui/src/component/prompt/index.tsxbuilt the label withLocale.titlecase(agent.id).Agent.Infoalready carries aname, and the API returns the lowercase id as the name for custom agents (work-item), while the built-ins keep their display names (General,Explore). The label now usesagent.name, so custom agents show the id they are configured under and the built-ins are unchanged.How did you verify your code works?
I could not run the TUI suite here: this environment has no
bun(and no installednode_modules), sobun test packages/tuidid not run and the app could not be started to look at the ribbon.What I checked by reading the code:
Agent.Info(packages/schema/src/agent.ts) has bothid: IDandname: Name, and itsdefaulthelper setsname: Name.make(id), so a custom agent's name is its id.local.agent.current()(packages/tui/src/context/local.tsx) returns that sameAgent.Info, soagent.nameis the display name the API sent.Localeis still used twice elsewhere in the file, so the import stays needed.This is the same class of bug as #30372, which fixed
capitalizeon custom agent identifiers in the legacy app prompt selector.Screenshots / recordings
N/A — the ribbon shows a text label, and I could not start the app in this environment to capture one.
Checklist
Model: MiniMax M3.1 Flash Free via the opencode agent harness (
minimax-m3.1-flash-free)Added by the opencode bot (AI-generated).
Related: #30372