Skip to content

feat: add workspace skills to agent chat slash menu#25600

Draft
ibetitsmike wants to merge 12 commits into
mainfrom
mike/workspace-skills-slash-menu
Draft

feat: add workspace skills to agent chat slash menu#25600
ibetitsmike wants to merge 12 commits into
mainfrom
mike/workspace-skills-slash-menu

Conversation

@ibetitsmike
Copy link
Copy Markdown
Collaborator

@ibetitsmike ibetitsmike commented May 22, 2026

This Pull Request was created by Mux working on behalf of Mike.

Adds a workspace skills API and SDK method that return skills exposed by active workspace agents, gated by workspace SSH access.

Updates the agent chat slash menu to query workspace skills alongside personal skills, qualify aliases when either source is not authoritative or names collide, keep qualified prefixes searchable, and keep the highlighted skill stable while skill sources load.

Reuses persisted chat context for existing chats when it belongs to the chat-bound agent, clears persisted context when workspace binding changes, and surfaces workspace agent load or selection errors in the menu.

Includes generated API/schema updates and regression coverage for authorization, agent failures, chat-agent selection failures, persisted context invalidation, qualified search, and menu error states.

@github-actions
Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/reference/api/schemas.md

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

Good direction: this wires workspace skills through the API, SDK, and slash menu, and the stories cover the combined menu behavior. Netero found 1 P2, 2 P3s, and 1 Nit. Reviewer quote: "The slash menu does not receive the workspace selected for a new chat."

This is a first-pass Netero review only. The full review panel has not reviewed this PR yet; the panel will review after these findings are addressed. These are defects to address before spending parallel panel review time.

🤖 This review was automatically generated with Coder Agents.

Comment thread site/src/pages/AgentsPage/components/AgentChatInput.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx Outdated
Comment thread site/src/api/queries/workspaceSkills.ts Outdated
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

Good direction: the PR wires workspace skills through API, SDK, and the slash menu, and the R1 Netero fixes are present in the current head. The panel found 1 P1, 3 P2s, and 3 P3s. Reviewer quote: "It is unguarded glass."

The highest-risk issue is the new workspace skills endpoint dialing an agent after only read-level workspace access. The main UI contract issues are that qualified aliases are displayed but not searchable by typing the qualifier, and the menu can still insert bare aliases before both skill sources are authoritative.

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/workspaceskills.go
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx Outdated
Comment thread coderd/workspaceskills.go
Comment thread coderd/workspaceskills.go Outdated
Comment thread coderd/workspaceskills.go Outdated
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

The R2 fixes moved the PR in the right direction: agent access is now explicitly gated, endpoint failures no longer masquerade as empty skills, and the source-prefix stories cover the basic collision path. This round found 4 P2s and 2 P3s. Reviewer quote: "The result is a user can start selecting the conservative qualified alias that the menu showed, then lose it mid-query."

The main remaining issue is source-of-truth drift. Existing chats can treat stale or missing injected context as authoritative, live endpoint data can stay selectable while it is stale, and source-qualified aliases can disappear when the opposite source finishes loading. There is also one auth contract mismatch to resolve around whether this chat feature should accept app-connect or match chat workspace binding.

🤖 This review was automatically generated with Coder Agents.

Comment thread site/src/pages/AgentsPage/components/ChatPageContent.tsx Outdated
Comment thread coderd/workspaceskills.go Outdated
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx Outdated
Comment thread coderd/workspaceskills_test.go
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerMenu.tsx Outdated
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

The latest round fixes the R3 items around SSH-only access, stale query data, qualified alias search, menu error messages, and the main persisted-context invalidation path. I found 1 P2 and 2 P3s remaining. Reviewer quote: "That reopens DEREM-6 for non-first chat agents."

The remaining blocker is still a source-of-truth mismatch for existing chats, but now narrowed to multi-agent workspaces where the chat-bound agent is not the page fallback agent. Two smaller issues remain around misconfiguration signaling and keyboard selection stability while skill sources arrive asynchronously.

🤖 This review was automatically generated with Coder Agents.

Comment thread site/src/pages/AgentsPage/components/ChatPageContent.tsx Outdated
Comment thread coderd/workspaceskills.go Outdated
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx Outdated
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

Mux working on behalf of Mike.

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

Mux working on behalf of Mike.

@coder-agents-review
Copy link
Copy Markdown

coder-agents-review Bot commented May 22, 2026

Review in progress | Chat
Requested: 2026-05-22 15:07 UTC by @ibetitsmike

Review history
  • R5 (2026-05-22): 21 reviewers, 1 Nit, 1 P1, 10 P2, 11 P3, REQUEST_CHANGES. Review
  • R6 (2026-05-23): 23 reviewers, 1 Nit, 1 P1, 12 P2, 12 P3, REQUEST_CHANGES. Review

deep-review v0.5.0 | Round 8 | 6739542..4360aa1

Status: Netero (first pass)

Last posted: Round 7, 31 findings (2 P1, 14 P2, 14 P3, 1 Nit), REQUEST_CHANGES. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
DEREM-1 P2 Author fixed (3fa20c9) site/src/pages/AgentsPage/components/AgentChatInput.tsx:974 New-chat selected workspace skills are not queried R1 Netero Yes
DEREM-2 P3 Author fixed (3fa20c9) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:628 Personal aliases can be inserted before workspace collisions load R1 Netero Yes
DEREM-3 P3 Author fixed (3fa20c9) site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerMenu.tsx:33 SkillMenuItem.source is stored but never read R1 Netero Yes
DEREM-4 Nit Author fixed (3fa20c9) site/src/api/queries/workspaceSkills.ts:5 Workspace skills query key is outside the workspace hierarchy R1 Netero Yes
DEREM-5 P1 Author fixed (7fca616) coderd/workspaceskills.go:93 Workspace skills endpoint dials the agent after only read-level authorization R2 Ryosuke P1, Knov P2, Kurapika P2 Yes
DEREM-6 P2 Author fixed (7fca616) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:620 Existing chats can list live workspace skills that chatd cannot resolve R2 Razor P2, Meruem P2, Hisoka P2 Yes
DEREM-7 P2 Author fixed (7fca616) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:640 Qualified aliases disappear when typed with their source prefix R2 Pariston P2, Mafuuu P2, Knov P2, Chopper P3, Kite P3, Luffy P3, Mafu-san P2, Meruem P3, Nami P3, Robin P3, Zoro P3 Yes
DEREM-8 P2 Author fixed (7fca616) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:630 Collision qualification still emits bare aliases while the opposite source is unresolved R2 Zoro P2, Hisoka P3, Kite P3, Luffy P3, Mafu-san P3, Melody P3, Nami P3, Razor P3 Yes
DEREM-9 P3 Author fixed (7fca616) coderd/workspaceskills.go:94 Connected-agent retrieval failures are reported as successful empty skill lists R2 Chopper Yes
DEREM-10 P3 Author fixed (7fca616) coderd/workspaceskills.go:34 Slash-menu fetch pays full workspace DTO fanout before repeating narrower queries R2 Knuckle Yes
DEREM-11 P3 Author fixed (7fca616) coderd/workspaceskills.go:49 Delete-transition workspaces fall through to agent skill lookup R2 Knuckle Yes
DEREM-12 P3 Dropped by orchestrator (superseded by posted functional findings) site/src/pages/AgentsPage/components/AgentChatInput.tsx:490 DEREM-1 selected-workspace path lacks direct story coverage R2 Bisky No
DEREM-13 P3 Dropped by orchestrator (superseded by DEREM-8) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.stories.tsx:217 DEREM-2 loading branch is not covered by the collision story R2 Bisky No
DEREM-14 P3 Dropped by orchestrator (metadata-only RPC is an optimization once DEREM-5 gates agent access) coderd/workspaceskills.go:101 Workspace skills endpoint fetches full context config instead of metadata only R2 Knov No
DEREM-15 P3 Dropped by orchestrator (low-risk internal mapping drift) coderd/x/chatd/chattool/skill.go:45 Context-part to SkillMeta conversion is duplicated in persisted rehydration R2 Robin No
DEREM-16 P3 Dropped by orchestrator (module naming cleanup, no direct behavior impact) site/src/pages/AgentsPage/utils/personalSkills.ts:57 Generic skill filtering still lives in personalSkills.ts R2 Gon No
DEREM-17 P2 Dropped by orchestrator (comment issue downgraded below posted threshold) coderd/x/chatd/chattool/skill.go:43 Exported helper comment says chat tools while endpoint also uses it R2 Gon No
DEREM-18 Nit Dropped by orchestrator (style-only cleanup) coderd/workspaceskills_test.go:69 reflect.DeepEqual could be slices.Equal R2 Ging-Go No
DEREM-19 Nit Dropped by orchestrator (style-only cleanup) coderd/x/chatd/agentselect/agentselect_test.go:164 tt := tt loop shadows are obsolete R2 Ging-Go No
DEREM-20 Nit Dropped by orchestrator (style-only cleanup) site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerMenu.tsx:37 skillTriggerText is a pass-through helper R2 Gon, Robin, Zoro No
DEREM-21 Nit Dropped by orchestrator (dead helper is low-risk cleanup) site/src/pages/AgentsPage/utils/personalSkills.ts:28 personalSkillTriggerText is production-dead R2 Meruem No
DEREM-22 Nit Dropped by orchestrator (commit hygiene, not code review blocker) commit c6f3c5c Commit scope does not cover backend files R2 Leorio No
DEREM-23 P3 Dropped by orchestrator (covered by DEREM-9 unless response semantics stay empty) codersdk/workspaceskills.go:23 SDK doc does not describe empty results for unavailable agents R2 Leorio No
DEREM-24 P3 Dropped by orchestrator (covered by DEREM-7 and DEREM-8) site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerMenu.stories.tsx:176 New menu lacks error-state story coverage R2 Nami No
DEREM-25 P2 Author fixed (f0edb12) site/src/pages/AgentsPage/components/ChatPageContent.tsx:313 Existing chat override treats stale or absent injected context as authoritative skills R3 Netero P2, Hisoka P2, Nami P2 Yes
DEREM-26 P2 Author fixed (f0edb12) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:663 Source-qualified aliases disappear when the opposite source finishes without a collision R3 Nami P2, Mafuuu P3, Pariston P3 Yes
DEREM-27 P2 Author fixed (f0edb12) coderd/workspaceskills.go:35 Workspace skills authorization still does not match chat workspace use R3 Kite P2, Meruem P2, Ryosuke P2 Yes
DEREM-28 P2 Author fixed (f0edb12) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:629 Live workspace skills can render stale cached endpoint data during refetch or error R3 Razor Yes
DEREM-29 P3 Author fixed (f0edb12) coderd/workspaceskills_test.go:25 Bad Gateway and delete-transition workspace skill branches are untested R3 Mafu-san P2, Bisky P3, Chopper P3 Yes
DEREM-30 P3 Author fixed (f0edb12) site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerMenu.tsx:296 Workspace skill failures always tell users to retry, including forbidden responses R3 Chopper Yes
DEREM-31 P3 Dropped by orchestrator (positive source-prefix story covers selection; negative assertion can be tightened with DEREM-26 coverage) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.stories.tsx:250 Workspace-prefix story asserts a selector that cannot exist R3 Bisky No
DEREM-32 P2 Dropped by orchestrator (coverage-only variant of DEREM-8, lower priority than current functional regressions) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:630 Unresolved-source guards lack story coverage R3 Mafu-san No
DEREM-33 P2 Dropped by orchestrator (name is now misleading, but renaming API field is too disruptive for this PR) codersdk/chats.go:318 Skill parts now use a context-file-named agent ID field R4 Netero No
DEREM-34 P2 Dropped by orchestrator (naming cleanup, no direct behavior impact) site/src/pages/AgentsPage/utils/personalSkills.ts:57 Workspace slash-trigger helpers still use personal-only names R4 Netero No
DEREM-35 P2 Author fixed (1233097) site/src/pages/AgentsPage/components/ChatPageContent.tsx:338 Persisted workspace skills are compared to the page fallback agent instead of chat-bound agent R4 Pariston P2, Kite P2, Kurapika P2, Melody P2, Razor P2, Ryosuke P2 Yes
DEREM-36 P3 Author fixed (1233097) coderd/workspaceskills.go:68 Chat-agent selection errors still return successful empty skill lists R4 Hisoka P3, Mafuuu P3, Chopper P3, Meruem P3, Ryosuke P3 Yes
DEREM-37 P3 Author fixed (1233097) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:695 Highlighted skill is tracked by array position across async source insertions R4 Meruem Yes
DEREM-38 P3 Dropped by orchestrator (coverage request, less important than DEREM-35 functional gap) site/src/pages/AgentsPage/components/ChatPageContent.tsx:335 Persisted-context workspace skill reuse branch has no regression test R4 Bisky No
DEREM-39 P3 Dropped by orchestrator (coverage request, less important than DEREM-36 functional gap) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:627 Workspace-skill menu tests never exercise live workspace query R4 Bisky No
DEREM-40 P2 Dropped by orchestrator (superseded by DEREM-36) coderd/workspaceskills_test.go:143 Delete-transition workspace build branch remains untested R4 Mafu-san No
DEREM-41 P2 Dropped by orchestrator (partly superseded by DEREM-35; legacy migration risk is not shown for current persisted data) site/src/pages/AgentsPage/components/ChatPageContent.tsx:69 Legacy skill-only contexts fall back to live workspace skills R4 Luffy No
DEREM-42 P2 Dropped by orchestrator (system-restricted action-aware route is desirable, but endpoint currently needs read-backed workspace object in existing router pattern) coderd/coderd.go:1219 Workspace skills route still requires read before SSH gate can run R4 Kurapika No
DEREM-43 P3 Dropped by orchestrator (UX copy polish after DEREM-30 fix) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:657 Agent-failure messages drop retry instruction R4 Leorio No
DEREM-44 P3 Dropped by orchestrator (cleanup only) site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerMenu.tsx:112 Explicit click path is dead code R4 Zoro No
DEREM-45 Nit Dropped by orchestrator (SDK comment polish) codersdk/workspaceskills.go:13 WorkspaceSkillMetadata doc repeats type name R4 Gon No
DEREM-46 Nit Dropped by orchestrator (SDK comment polish) codersdk/workspaceskills.go:23 WorkspaceSkills doc repeats method signature R4 Gon No
DEREM-47 Nit Dropped by orchestrator (timeout comment polish) coderd/workspaceskills.go:19 workspaceSkillsDialTimeout lacks rationale comment R4 Gon No
CRF-48 P2 Author fixed (34fa8b2) site/src/pages/AgentsPage/components/ChatPageContent.tsx:338 Existing chats can query live workspace skills before persisted context ownership is classified R5 Hisoka P2, Mafuuu P2, Chopper P3, Kite P2, Melody P3, Nami P2 Yes
CRF-49 P3 Author fixed (34fa8b2) coderd/workspaceskills_test.go:150 Delete-transition regression test still passes when the delete guard is removed R5 Mafu-san Yes
CRF-50 P3 Author fixed (34fa8b2) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:731 Highlighted skill key is overwritten when the selected source refetches R5 Pariston Yes
CRF-51 P2 Author fixed (addda28) site/src/pages/AgentsPage/components/ChatPageContent.tsx:337 Empty cached workspace context still falls back to live workspace skill queries R6 Netero P2 Yes
CRF-52 P2 Author fixed (addda28) site/src/api/queries/chats.ts:1185 Successful sends can leave the slash menu using stale chat detail cache R6 Pariston Yes
CRF-53 P3 Author fixed (addda28) site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerPlugin.tsx:208 Tab is swallowed when skills menu has no selected skill R6 Mafuuu Yes
CRF-54 P3 Dropped by orchestrator (coverage request, less important than CRF-51 and CRF-52 functional gaps) site/src/pages/AgentsPage/components/ChatPageContent.tsx:337 Persisted-context workspace-skills branch lacks frontend regression harness R6 Mafu-san No
CRF-55 P3 Dropped by orchestrator (coverage request for CRF-50 sibling) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:721 CRF-50 fix lacks selected-source-refetch story R6 Mafu-san No
CRF-56 P3 Dropped by orchestrator (covered by CRF-52 cache refresh path) site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:670 Workspace skill API errors discard server detail before rendering R6 Chopper, Leorio No
CRF-57 P3 Dropped by orchestrator (SDK doc polish) codersdk/workspaceskills.go:23 SDK doc hides empty response unavailable-agent semantics R6 Leorio No
CRF-58 Nit Dropped by orchestrator (low-priority field comment polish) codersdk/chats.go:316 ContextFileAgentID comment still says instruction-file persistence R6 Gon No
CRF-59 P2 Open site/src/api/queries/chats.ts:300 Watched chat cache merge keeps stale injected context when fresh event clears it R7 Netero Yes
CRF-60 P1 Open coderd/database/queries/chats.sql:1089 Workspace rebinding clears only context cache, leaving old context messages in replay R7 Hisoka Yes
CRF-61 P2 Open site/src/pages/AgentsPage/components/ChatPageContent.tsx:89 Message fallback reconstructs only one context message from additive context history R7 Hisoka P2, Razor P2 Yes
CRF-62 P3 Open site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx:670 Workspace skill errors hide actionable server detail from the menu R7 Chopper P3, Leorio P3 Yes
CRF-63 P3 Open coderd/workspaceskills_test.go:97 Agent connection success path does not assert release is called R7 Bisky Yes
CRF-64 P2 Dropped by orchestrator (related to CRF-51/CRF-60, needs backend context model decision) site/src/pages/AgentsPage/components/ChatPageContent.tsx:358 CRF-51 fallback rehydrates deliberately cleared context from old messages R7 Pariston No
CRF-65 P3 Dropped by orchestrator (test coverage request for CRF-53, lower priority than current functional findings) site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerPlugin.tsx:208 CRF-53 no-selection Tab path lacks story coverage R7 Mafu-san No
CRF-66 P2 Dropped by orchestrator (deferred as broader endpoint state semantics, earlier panels accepted empty unavailable-agent states) coderd/workspaceskills.go:89 Connecting agents are reported as authoritative empty workspace-skill set R7 Kite No
CRF-67 P3 Dropped by orchestrator (comment/name cleanup) site/src/pages/AgentsPage/components/ChatPageContent.tsx:77 workspaceContextFromMessages hides sentinel role of context-file parts R7 Gon No
CRF-68 P3 Dropped by orchestrator (SDK doc polish) codersdk/workspaceskills.go:23 SDK doc hides empty response unavailable-agent semantics R7 Leorio No
CRF-69 Nit Dropped by orchestrator (commit hygiene) commit addda28 Latest commit subject exceeds length guidance R7 Leorio No

Contested and acknowledged

None.

Round log

Round 1

Netero-only. 1 P2, 2 P3, 1 Nit. Reviewed against ca1f6b1..c6f3c5c.

Round 2

Panel. DEREM-1 through DEREM-4 addressed by author. New findings: 1 P1, 3 P2, 3 P3 posted. Several test, nit, and design suggestions dropped or covered by posted functional findings. Reviewed against ca1f6b1..3fa20c9.

Round 3

Panel. DEREM-5 through DEREM-11 addressed by author. New findings: 4 P2, 2 P3 posted. Reviewed against ca1f6b1..7fca616.

Round 4

Panel. DEREM-25 through DEREM-30 addressed by author. New findings: 1 P2, 2 P3 posted. Reviewed against ca1f6b1..f0edb12.

Round 5

Panel. DEREM-35 through DEREM-37 addressed by author. New findings: 1 P2, 2 P3 posted. Reviewed against ca1f6b1..1233097.

Round 6

Panel. CRF-48 through CRF-50 addressed by author. New findings: 2 P2, 1 P3 posted. Reviewed against 6739542..34fa8b2.

Round 7

Panel. CRF-51 through CRF-53 addressed by author. New findings: 1 P1, 2 P2, 2 P3 posted. Reviewed against 6739542..addda28.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Kurapika security
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerMenu.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerMenu.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx Outdated
Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

The current round fixes the non-first chat-agent case, agent selection errors, and the selection-key path for sources arriving. I found 1 P2 and 2 P3s. Reviewer quote: "The extinguisher has no gauge."

One source-of-truth issue remains during the initial page-load window for existing chats: until the workspace DTO supplies the bound agent, the composer can still fall back to live workspace skills instead of the persisted context the next chat turn will use. The other two findings are narrower regression and async-selection gaps.

🤖 This review was automatically generated with Coder Agents.

Comment thread site/src/pages/AgentsPage/components/ChatPageContent.tsx Outdated
Comment thread coderd/workspaceskills_test.go Outdated
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx Outdated
…-slash-menu

# Conflicts:
#	docs/reference/api/chats.md
#	docs/reference/api/schemas.md
#	site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.stories.tsx
#	site/src/pages/AgentsPage/components/ChatMessageInput/PersonalSkillsTriggerMenu.tsx
#	site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerPlugin.tsx
#	site/src/pages/AgentsPage/utils/personalSkills.ts
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

Mux working on behalf of Mike.

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

Mux working on behalf of Mike.

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

The latest fixes address the chat-bound agent comparison, the delete-transition test hole, and selection identity for source arrivals. I found 2 P2s and 1 P3 remaining. Reviewer quote: "This is the same class as DEREM-6 and CRF-48."

Two remaining issues are still source-of-truth problems for existing chats: an empty cached workspace context and a stale chat detail cache can both make the slash menu use live workspace skill data that the next turn will not resolve. The third issue is a keyboard trap when the menu is open but no skill is selected.


site/src/api/queries/chats.ts:1185

P2 [CRF-52] Successful sends can leave the slash menu using a stale chat detail cache instead of the workspace skills that were just persisted. (Pariston)

A normal send is one of the paths that creates or changes that cache: postChatMessages calls SendMessage, persistInstructionFiles writes last_injected_context, and subsequent turns reuse skillsFromParts instead of dialing live workspace skills.

The composer gets lastInjectedContext from chatQuery.data, but createChatMessage only invalidates debug runs and prompt history on success. The watched-chat merge path updates status, title, workspace, build, model, summary, unread, and timestamp, but not last_injected_context. After the first workspace-backed send persists skill A, the open page can still have an undefined or old last_injected_context; if the workspace skills change, opening / can fetch live skill B even though the next turn resolves against persisted skill A. Invalidate or update chatKey(chatId) after successful sends, or include last_injected_context in watched chat cache merges.

🤖

🤖 This review was automatically generated with Coder Agents.

Comment thread site/src/pages/AgentsPage/components/ChatPageContent.tsx
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/SkillsTriggerPlugin.tsx Outdated
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

Mux working on behalf of Mike.

Copy link
Copy Markdown

@coder-agents-review coder-agents-review Bot left a comment

Choose a reason for hiding this comment

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

The latest changes fix the round 6 findings around stale chat detail, empty context fallback, and Tab behavior. I found 1 P1, 2 P2s, and 2 P3s. Reviewer quote: "The cache and replay history cannot diverge."

The highest-risk issue is that workspace rebinding clears the injected-context cache but leaves old context messages in the prompt replay path. The other findings are cache reconstruction, error detail, and release-coverage issues around the same workspace-skill surface.

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/database/queries/chats.sql
Comment thread site/src/api/queries/chats.ts Outdated
Comment thread site/src/pages/AgentsPage/components/ChatPageContent.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/ChatMessageInput/ChatMessageInput.tsx Outdated
Comment thread coderd/workspaceskills_test.go Outdated
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

Mux working on behalf of Mike.

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