Skip to content

feat(agents): put main agent choice in the card's actions menu - #1530

Open
morgmart wants to merge 8 commits into
mainfrom
morgan/main-agent-context-menu
Open

morgmart wants to merge 8 commits into
mainfrom
morgan/main-agent-context-menu

Conversation

@morgmart

@morgmart morgmart commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What changed

On the Agents page, choosing the main agent was only reachable from a separate right-click menu. Now right-clicking an agent card and its "..." button open the same menu, and that menu includes the main agent choice.

  • Right-click and the "..." button share one set of actions: Make main agent, Open settings, Copy public key, Delete agent.
  • "Default agent" is renamed "Main agent".
  • The "Main agent" label stays in the top-left corner, moved slightly in from the edge, at 14px. It uses primary text, so it is dark on light cards and light on dark cards.
  • The main agent stays put. It changes only when you pick another one or it's deleted. It is still tagged when its runtime is signed out or broken, so the failure shows on the agent you expect. If it's deleted, the next available agent takes over. Without a choice, the first automatic pick is saved so it doesn't shift between loads.
  • Right-clicks inside an already open menu (like the model picker) no longer open the card menu on top of it.

Screenshots

Right-click on a card:

Right-click menu with Make main agent

"..." button opens the same menu:

Actions button menu

Main agent label, wide and narrow:

Wide, light

Wide, dark

Narrow, light

Narrow, dark

Testing

  • Main agent tests cover the saved first pick, a temporarily missing choice coming back, and a deleted choice being replaced.
  • Agents page tests cover mouse right-click, Shift+F10, Make main agent from both menus, the main label moving between agents, and delete from the right-click menu.
  • Screenshots were captured from a local browser fixture with sample agents.

🤖 Generated with Claude Code

morgmart and others added 2 commits October 21, 2026 19:32
Right-click and the "..." button now open the same actions, including
Make main agent. "Default agent" is renamed "Main agent", and its label
sits centered above the avatar.

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e card menu

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@morgmart
morgmart requested a review from a team as a code owner October 22, 2026 02:45

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord’s automated source review via Wes’s account, integrating independent Rocket (systems/lifecycle), Mantis (correctness/security), and Groot (product/accessibility) reviews.

No actionable findings. Source assessment: 9/10. Both entry points reuse the same action list and preserve the main-agent eligibility and deletion-confirmation gates. AgentCard, shared Menu/ContextMenu and AgentDelete retain ownership; the dialog now sits outside the card context-menu subtree. The change is proportionate to the stated menu-parity goal.

Reviewed head: 8d8a078. Base: d118b56. All four changed files and relevant callers, shared menu/dialog owners, and error/retry paths were inspected. The public description, commit metadata, and visible pixels of all six attached screenshots showed no disclosure finding. Screenshot metadata was not inspected.

Validation is source-only: no tests, builds, apps, or native workflows executed. One hosted CI snapshot at 02:47 UTC still had JavaScript, Rust, browser journeys/measurements and Vitest flake checks running; completed checks had succeeded, with Windows and browser flake lanes skipped. Added colocated tests cover main-agent selection and right-click deletion; no browser journeys were added or removed. Live portal isolation, deletion error/cancel focus restoration, touch behavior, screen-reader output, enlarged text and human acceptance remain unverified. This COMMENT is advisory, not approval or merge authorization.

morgmart and others added 2 commits October 21, 2026 19:51
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord’s automated source review via Wes’s account, integrating independent Rocket (systems/lifecycle), Mantis (correctness/security/concurrency), and Groot (product/accessibility) reviews.

No new actionable findings. Source assessment: 9/10. This follow-up checks the changes since reviewed head 8d8a078: the corner label and stable main-agent persistence, plus their integration with the existing shared card menus. Automatic selection waits for complete inventory and settled archive loading, preserves temporarily missing choices, replaces known-archived choices, and does not save a route-requested agent as the main agent. The existing agentChoices projection and scoped view-state store remain the owners.

Optional existing limitation: successful Delete without relay archival (service.ts:3357–3368, then 2301–2306) leaves the old saved key. The new replacement condition at default-agent.ts:58–63 therefore persists a successor only for confirmed archived deletions; other deleted choices continue using an unsaved stand-in, as at base. Explicit Make main agent recovers. A follow-up could clear the matching scoped choice after confirmed local deletion and cover that path without interpreting temporary absence as deletion.

Reviewed head: 323bf0d. Base: d118b56. The public description, commit metadata and visible pixels of all six attached fixture screenshots showed no disclosure finding; image metadata was not inspected.

Validation is source-only: no tests, builds, apps or native workflows executed. The 03:28 UTC hosted snapshot had three browser shards still running; other completed executed checks succeeded, with Windows native and browser-flake lanes skipped. The new colocated tests cover stable first selection, temporary absence and archive replacement; no browser cases were added or removed. Live restart/cross-window persistence, storage failures, native execution, screen-reader output, enlarged text, error/retry focus restoration and human acceptance remain unverified. This COMMENT is advisory, not approval or merge authorization.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Carl, an automated reviewer, commenting via Wes’s GitHub account. This review combines independent Court lanes: Mongo (persistence), Princess Donut (UX/a11y) and Mordecai (challenge pass).

Verdict: one recommended blocker, two optional items. Source assessment: 8/10. Menu parity, the Shift+F10 portal guard, the delete dialog moving out of the context-menu trigger, and focus return after Delete → Cancel from both menus all check out.

  • Recommended blocker: a deletion that succeeds without archiving never replaces the saved main agent (inline on default-agent.ts). Reproduced with the real hook.
  • Optional: long-press is not guarded against portal touches (inline on AgentsPage.tsx). A stand-in shows "Main agent" but can't be pinned (inline).
  • Optional, outside the diff: docs/solo/README.md:123-126 still says "Agents → right-click → Make default agent" and "Default agent", and describes the old fallback rules.

Merge criteria: after a successful delete, the saved choice moves to a stable replacement, whether or not the agent was archived. Add a hook test where archives are unavailable.

Validation: source review plus scratch Vitest/jsdom probes (since reverted) at 323bf0d4. Not run: the native app or full suites. CI was green at this head.

Comment thread src/features/solo/default-agent.ts
Comment thread src/bundled/agents/AgentsPage.tsx
Comment thread src/bundled/agents/AgentsPage.tsx
Address review: a finished Delete forgets the saved main agent in every
scope, so the next available agent is saved in its place even without
archive evidence. Long-presses in open menus no longer open the card
menu, a stand-in for a missing choice offers Make main agent, and the
Solo docs describe the main agent.

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord’s automated source review via Wes’s account, integrating independent Rocket (systems/lifecycle), Mantis (correctness/security/concurrency), and Groot (product/accessibility) reviews.

One P2 remains in the deletion repair; see the inline finding. The stand-in menu and portal long-press changes address the prior optional comments, and unsuccessful deletion correctly preserves the saved choice. Source assessment: 8/10 until deleted selection evidence is excluded before fallback persistence.

Reviewed head 2977c82cb5631da4ea161104cb9ad81fcf272264, base d118b56700832351281781379cf02971fdbb6cfa; focused on the eight-file repair since 323bf0d4394e16794c91890b6b2c9507337ad0ff and its supported callers. Shared Menu/ContextMenu, MenuNote and Dialog ownership is preserved. Public description, commit metadata and all six attached fixture screenshots were inspected; no evident private material was identified in those surfaces.

Validation: source-only; no PR code, tests, builds, app launches or runtime/performance measurements executed. Added hook/component coverage and the service failure assertion were read; the hook test removes the deleted candidate itself and therefore misses the shared-library boundary described inline. No browser cases were added or removed in the repair; fail-then-pass was not reproduced. A single hosted-check snapshot at 19:04 UTC had successful completed checks, browser/JavaScript/native work still running or queued, and Windows native validation skipped. Real touch, rendered focus/error/retry behavior, native deletion and human acceptance remain unverified. This COMMENT is advisory, not approval or merge authorization.

Comment thread src/features/agents/service.ts Outdated
…gent

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord automated source review via Wes’s account, integrating independent Rocket (systems/lifecycle), Mantis (correctness/concurrency), and Groot (product/accessibility) reviews.

Reviewed head ea86096706ac0885670e7999b2d520c1e54e6d7e against base d118b56700832351281781379cf02971fdbb6cfa, focusing on the four-file follow-up since 2977c82cb5631da4ea161104cb9ad81fcf272264. One remaining P2 is detailed inline. The idle-library handoff is repaired, but the already-running read case still needs a fix. Source assessment: 8/10 for correctness; the proposed repair can stay with the existing inventory owner.

The added mounted-selection test covers an idle refresh, and the service test checks refresh-before-forget ordering. Neither holds a pre-delete inventory read open across actual removal. No browser cases added or removed in this follow-up; fail-then-pass evidence was not reproduced. Existing shared Menu/Dialog owners remain unchanged. The public description, six sample screenshots, and commit metadata were inspected with no evident private material found.

Source-only: no tests, builds, app launches, or PR code executed. The 19:18 UTC hosted-check snapshot had completed checks successful, browser/JavaScript/native work still running, and Windows native validation skipped. Native deletion, rendered keyboard/focus behavior, runtime performance, and human acceptance remain unverified. This is a non-blocking COMMENT review, not approval or merge authorization.

Comment thread src/features/agents/service.ts Outdated
…leted main agent

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord’s automated source review via Wes’s account, integrating independent Rocket (systems/lifecycle), Mantis (correctness/concurrency), and Groot (product/accessibility) reviews.

Reviewed head 7b8f7a5 against base d118b56; this follow-up checks the five-file change since ea86096, its prior finding, and affected callers. One P3 correctness issue is recorded inline. Source assessment: 8/10 until superseded refresh callers retain their completion guarantee.

The prior deleted-agent resurrection is fixed: cancelled reads cannot publish or clear a newer read’s state. The native inventory already uses generation fencing. The new regression test covers stale results arriving after the fresh result, but does not cover an existing caller resuming while the replacement read is still pending.

Validation: immutable source inspection only; no tests, app launches, builds, or live deletion/send reproduction. Browser cases added/removed by this follow-up: 0/0; new coverage is at the component/service layer. Fail-before/pass-after behavior was not executed. Public description, commit metadata and all six attached fixture screenshots were inspected with no evident sensitive disclosure. Rendered keyboard/focus/error recovery, native behavior, performance and human acceptance remain unverified. One hosted-check snapshot at approximately 20:03 UTC showed successful completed checks, with browser, JavaScript and Rust jobs still running; Windows validation was skipped. This COMMENT review is not approval or a merge recommendation.

Comment thread src/features/agents/library.ts
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants