Skip to content

fix(chat): offer no agent pin on a template-bound session - #25108

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/25099-template-pin-agent
Oct 28, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/25099-template-pin-agent

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On a plain new chat, the model picker stops offering a "pin to agent" row that can only fail.

In a chat opened without picking an agent, the composer's model dropdown offers "Pin <model> to the kirocrew agent". Clicking it shows "Could not set the agent's default model" with kirocrew: Agent 'kirocrew' not found, and nothing changes.

Why it matters

Every plain chat shows this row, and it fails every time. It also raises a critical notification each time someone tries it.

Not a goal

  • Changing how pinning works for a real crew agent. That path is unchanged.
  • Letting a template carry its own pinned model. The Set default row already sets what a template session inherits.
  • Changing the server. It is right to answer 404: kirocrew is not a key of config.agents.

What changed (motivation → approach → change)

Symptom: the pin row is offered on a template-bound session and always fails.

Cause: since #18342 a plain session is bound to the kirocrew template (agent_kind: "template"). useComposerChips in composerChips.ts still used the slot's agent name as the pin target, so the write went to PUT /api/agents/kirocrew, which has no config.agents entry.

Change: the pin target is now empty unless it names a real crew agent. That means the slot is not agent_kind: "template", and the name resolves in the roster to a non-template row. The dropdown already hides the row when the target is empty, so ComposerDockView and ModelEffortDropdown need no change. This is the most conservative choice: it removes an action that cannot succeed and adds none.

Decision: the row is withheld, not redirected to the default crewmate. A template session does not read that crewmate's pin, so redirecting would write a setting that has no effect on the session shown.

Backwards compatibility

Compatible: crew-agent sessions keep the same pin row and write; only a row that always failed is no longer shown.

Removes nothing: the hidden row never produced a working write on a template session.

Tests

website/src/test/useChatPageComposerChips.test.tsx, new block "which agent the pin row may target (#25099)":

  • a template-bound slot gets no pin target;
  • a slot with no kind whose name is only a template gets no pin target;
  • a template-bound slot gets no pin target even when a crew agent shares its name;
  • a member slot keeps its crew agent as the target.

The first three fail on origin/main and pass with the fix (checked by restoring the old composerChips.ts). The existing harness now lists builder as a member row, as the real roster does.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

N/A — unit coverage sufficient: the dropdown's existing onPinToAgent && agentName guard decides visibility, and the hook's output is what changed.

Screenshots / video

Why no screenshot: the only visible effect is that one dropdown row is no longer rendered on template sessions; no layout or style changes.

Related Issues

Closes #25099

Sibling sweep

Swept: git grep -n "updateKirocrewAgent(" -- website/src
Sibling: website/src/pages/settings/useChatPanelModels.ts:320 -- not affected -- it clears a pin only when the default agent's config row carries a model
Sibling: website/src/pages/members/CrewProfileSettings.tsx:204 -- not affected -- it writes a member read from the member roster
Sibling: website/src/components/crew/useCrewEditor.ts:641 -- not affected -- it writes the crew agent open in the editor

Pattern harvest

Not generalizable: #16809 fixed the same name mismatch on the agent picker; this was the last slot-name-to-config-agent write in the composer.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 28, 2026 02:43
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of e55388bc9b4c3fbe702b38c6dff7a5ac6f98efc8 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check. The diff only stops showing a pin row that always failed on template-bound chats. It adds no control, and the dropdown without that row is a state that already ships, so the missing screenshot leaves nothing unseen.

[UX-REVIEWED] e55388b

Description read

[DESCRIPTION-READ] c0ed9ed497c3e415c227e0231bca9cc940215100c1f7dd25d639fe95ae09eb02

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of e55388bc9b4c3fbe702b38c6dff7a5ac6f98efc8 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change only hides a pin row that always failed, so it is easy to revert and has no compatibility risk.

Notes

  • The pin row now depends on roster membership, so it disappears whenever installedAgents is empty. sessionRosters.ts:30 says the roster is empty during a session switch, so a crew-agent session loses its pin row for a moment. Before this change the row stayed, so this is a small new flicker. It could be avoided by checking agent_kind === 'member' first.

[DESIGN-REVIEWED] e55388b

Description read

[DESCRIPTION-READ] 5f7c681aadb0b45dfec0d61a80dd9520e69117db9a2ef29b23330c479c3c475c

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of e55388bc9b4c3fbe702b38c6dff7a5ac6f98efc8 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

One pin row that always failed is now withheld. The fix sits at cause level (the pin target is never a template), with a linked issue and tests that fail on base.

What this change ships

Inventory (3 items) — 3 justified

Intent: stop a plain new chat's model picker from offering a "pin to agent" row that always fails with a 404. FIX.

  1. On a template-bound chat (a plain new chat), the model dropdown no longer shows "Pin <model> to the kirocrew agent" — justified
  2. The pin row is also withheld when the slot has no kind and its name matches only a template row in the roster — justified
  3. The pin row is also withheld when the target name is missing from installedAgents; before, it was offered and the write could 404 — justified

[FIRST-PRINCIPLES-REVIEWED] e55388b

Description read

[DESCRIPTION-READ] dd4d51e3ebe85fb9ffdb12ce2ecd8fc486ed53cb8f380df6c6999381981d9212

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed e55388bc9b4c3fbe702b38c6dff7a5ac6f98efc8 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] e55388b

Verdict parsed from the review's SHA-scoped output markers for commit e55388bc9b4c3fbe702b38c6dff7a5ac6f98efc8.

False positive or not applicable? A repository writer can comment:
/ai-review override fable e55388bc9b4c3fbe702b38c6dff7a5ac6f98efc8 false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of e55388bc9b4c3fbe702b38c6dff7a5ac6f98efc8 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] e55388b

False positive or not applicable? A repository writer can comment:
/ai-review override gpt e55388bc9b4c3fbe702b38c6dff7a5ac6f98efc8 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 28, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) October 28, 2026 04:04

@KiroCrewCaptain KiroCrewCaptain 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.

Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: fix: the composer's model-pin row targets no agent on a template-bound session, so it no longer writes an agents entry that does not exist (#25099); frontend hook change plus tests.

@KiroCrewCaptain
KiroCrewCaptain merged commit 17c5de1 into main Oct 28, 2026
109 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/25099-template-pin-agent branch October 28, 2026 04:05
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 28, 2026
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.

Model picker offers the agent pin on a template session, then fails with "Agent 'kirocrew' not found"

2 participants