Skip to content

feat: support personal skills in chats#25366

Open
ibetitsmike wants to merge 5 commits into
mike/personal-skills-api-testsfrom
mike/personal-skills-chattool
Open

feat: support personal skills in chats#25366
ibetitsmike wants to merge 5 commits into
mike/personal-skills-api-testsfrom
mike/personal-skills-chattool

Conversation

@ibetitsmike
Copy link
Copy Markdown
Collaborator

@ibetitsmike ibetitsmike commented May 14, 2026

Created by Mux on behalf of Mike.

Stack Context

This stack splits experimental personal skills into smaller reviewable PRs. This PR builds on #25365 and completes the feature wiring.

Stack order:

  1. feat: add personal skill resolver #25362 personal skill resolver
  2. feat: add personal skill storage, API, and SDK #25363 storage, permissions, API, and SDK
  3. test: cover personal skill API #25365 API test coverage
  4. feat: support personal skills in chats #25366 chattool and chatd integration

What?

Updates chattool skill formatting and read_skill resolution so tools can read personal skills from the database, then injects personal skill metadata into chatd prompts and registers the skill-reading tools when skills are available.

Why?

The chattool and chatd changes need to land together so the intermediate stack state stays buildable. This completes personal skill availability in chats without syncing personal skills into workspace filesystems.

Copy link
Copy Markdown
Collaborator Author

ibetitsmike commented May 14, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ibetitsmike ibetitsmike changed the title feat(coderd/x/chatd/chattool): support personal skill reads feat(coderd/x/chatd): support personal skills in chats May 14, 2026
@ibetitsmike ibetitsmike changed the base branch from mike/personal-skills-api-tests to graphite-base/25366 May 14, 2026 20:55
@ibetitsmike ibetitsmike changed the title feat(coderd/x/chatd): support personal skills in chats feat: support personal skills in chats May 14, 2026
@ibetitsmike ibetitsmike changed the base branch from graphite-base/25366 to mike/personal-skills-api-tests May 14, 2026 21:18
@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.

Well-structured integration PR. The source-aware skill resolution, collision aliasing, error sanitization, and mid-turn refresh are all cleanly implemented with thorough test coverage (1:1.76 code-to-test ratio). The userSkillContext RBAC comment is one of the better security justifications in the codebase.

Severity breakdown: 5 P3, 1 P4, 2 Nit. No blocking issues.

The strongest signal across the panel is the cross-package coupling between isSkillIndexMessage (chatd.go) and renderSkillIndex (skill.go), which 10+ reviewers flagged independently. A shared constant for the XML tags would make the dependency explicit and compiler-enforced.

Process note: workspace skill errors still leak raw err.Error() to the LLM (pre-existing), while personal skill errors are properly sanitized. This PR sets the better standard; aligning workspace errors would be a good follow-up.

"The person reading this at 2 AM knows exactly why this actor exists and what it can't do." (Leorio, on the userSkillContext comment)

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/x/chatd/chatd.go Outdated
Comment thread coderd/x/chatd/chatd.go
Comment thread coderd/x/chatd/chattool/skill.go
Comment thread coderd/x/chatd/chatd.go
Comment thread coderd/x/chatd/chattool/skill.go Outdated
Comment thread coderd/x/chatd/chattool/skill.go Outdated
Comment thread coderd/x/chatd/chattool/skill.go
Comment thread coderd/x/chatd/chattool/skill.go
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-chattool branch from 5acacdf to ddcbe2a Compare May 15, 2026 05:56
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-api-tests branch from 3066778 to b0d7678 Compare May 15, 2026 05:56
@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.

All 8 R1 findings addressed cleanly. Constants for the XML tags, single-site logging, explicit error type checks, injectedSkillIndex sync, skill name in error messages, doc comments, simplified delegation, and consistent JSON nullability are all verified.

One new finding from R2: ParsePersonalSkillMarkdown failures in loadPersonalSkillBody produce no server-side log entry. The DB error path logs, the parse error path does not.

"If validation rules evolve between versions or if a migration corrupts content, the operator has no trace of the root cause." (Chopper)

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/x/chatd/chatd.go Outdated
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-api-tests branch from b0d7678 to 6231ffc Compare May 15, 2026 06:30
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-chattool branch from ddcbe2a to 83fc999 Compare May 15, 2026 06:30
@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.

DEREM-12 verified fixed. All 12 prior findings are closed.

One new finding: the test helper that validates the synthesized RBAC actor only checks the actor ID, not the security-critical role.

Razor traced a pre-existing edge case worth knowing: workspace skill names are not validated against SkillNamePattern, so a workspace SKILL.md declaring name: personal/deploy could shadow a personal skill's qualified alias. The fix belongs in workspace skill discovery, not this PR.

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/x/chatd/chatd_internal_test.go
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-api-tests branch from 6231ffc to 81c22bf Compare May 15, 2026 07:07
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-chattool branch from 83fc999 to 53e45b3 Compare May 15, 2026 07:07
@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.

All 13 prior findings verified fixed. DEREM-13 (role assertion) confirmed addressed.

One new finding: the description tag on ReadSkillArgs.Name and ReadSkillFileArgs.Name says "kebab-case" but qualified aliases (personal/deploy) contain /. Models that weight schema descriptions may avoid passing qualified aliases, causing "not found" on collision scenarios.


coderd/x/chatd/chattool/skill.go:282

P3 [DEREM-14] The description tag reads "The kebab-case name of the skill to read." (same pattern at line 353 for ReadSkillFileArgs). This PR introduces collision aliases of the form personal/deploy and workspace/deploy, which contain / and are not kebab-case. The schema description now contradicts the tool's actual input contract.

The system prompt mitigates with "When a skill is listed as personal/name or workspace/name, pass that qualified alias to read_skill." But models that weight schema descriptions heavily may still avoid non-kebab-case inputs, causing "not found" on collision scenarios.

Could we update both descriptions to "The name or qualified alias of the skill to read."? (Mafuuu P3)

🤖

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-api-tests branch from 81c22bf to eb5d4a3 Compare May 15, 2026 07:26
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-chattool branch from 53e45b3 to c3af07b Compare May 15, 2026 07:26
@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.

Review blocked. DEREM-14 (P3) has not been addressed or acknowledged.

DEREM-14 (skill.go:282,353): ReadSkillArgs.Name and ReadSkillFileArgs.Name description tags say "The kebab-case name of the skill to read" but this PR introduces qualified aliases (personal/deploy, workspace/deploy) that contain / and are not kebab-case. The schema description contradicts the tool's input contract. Models that weight schema descriptions may avoid passing qualified aliases, causing "not found" on collision scenarios. Suggested fix: update both descriptions to "The name or qualified alias of the skill to read."

Note: this finding was folded into the R4 review body because line 282 is outside the diff hunks; it may have been easy to miss.

Further review is blocked until this finding is addressed, acknowledged, or contested.

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@ibetitsmike ibetitsmike requested a review from Emyrk as a code owner May 15, 2026 09:02
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-chattool branch from b35f358 to 0527a03 Compare May 15, 2026 09:02
@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.

Post-approval rebase introduced ErrSkillAmbiguous from the downstack PR. The test was updated to expect it, but the tool handlers weren't updated to surface the disambiguation information.

One new finding: when the LLM calls read_skill("deploy") and both personal/deploy and workspace/deploy exist, the handler returns a generic "failed to resolve skill" instead of telling the LLM which qualified aliases to use. The qualified aliases are safe to surface (already in the system prompt).

🤖 This review was automatically generated with Coder Agents.

Comment thread coderd/x/chatd/chattool/skill.go Outdated
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-api-tests branch from 6d5a8ef to e74891b Compare May 15, 2026 09:21
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-chattool branch from 0527a03 to 92012df Compare May 15, 2026 09:21
@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.

All 15 findings across 8 rounds are resolved. DEREM-15 (ErrSkillAmbiguous) verified fixed: skillResolveErrorResponse now surfaces qualified aliases to the LLM via a dedicated ErrSkillAmbiguous branch, with test coverage in both ReadSkill and ReadSkillFile tools.

No new findings from the R8 panel or Netero. Clean.

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

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.

No-op rebase (zero diff in chatd files). All 15 findings remain fixed. No new findings from the R9 panel or Netero.

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-api-tests branch from ac22415 to a7c44a4 Compare May 15, 2026 23:30
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-chattool branch from a12d04a to 7eea5eb Compare May 15, 2026 23:30
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

Mux working on behalf of Mike.

@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-api-tests branch from a7c44a4 to 2e2deae Compare May 15, 2026 23:34
@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-chattool branch from 7eea5eb to 990a6d5 Compare May 15, 2026 23:34
@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

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.

No-op rebase (zero diff in chatd files). All 15 findings remain fixed. No new findings from the R10 panel or Netero.

🤖 This review was automatically generated with Coder Agents.

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.

No-op rebase (zero diff in chatd files). All 15 findings remain fixed. No new findings from the R11 panel or Netero.

🤖 This review was automatically generated with Coder Agents.

@ibetitsmike
Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

Mux working on behalf of Mike.

@ibetitsmike ibetitsmike force-pushed the mike/personal-skills-chattool branch from 990a6d5 to 819bb7b Compare May 15, 2026 23:59
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.

No-op rebase (zero diff in chatd files). All 15 findings remain fixed. No new findings from the R12 panel or Netero.

🤖 This review was automatically generated with Coder Agents.

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.

1 participant