feat(coderd/x/chatd): persist skills as message parts like AGENTS.md#23748
Open
feat(coderd/x/chatd): persist skills as message parts like AGENTS.md#23748
Conversation
0e18b9f to
66eeef0
Compare
Skills are now discovered once on the first turn (or when the workspace agent changes) and persisted as `skill` message parts alongside `context-file` parts. On subsequent turns, the skill index is reconstructed from persisted parts instead of re-dialing the workspace agent. This makes skills consistent with the AGENTS.md pattern: discover once, persist as parts, read from parts on subsequent turns. The in-memory skillsCache remains for read_skill/read_skill_file tool calls that need full skill bodies. Changes: - Add `skill` ChatMessagePartType with SkillName and SkillDescription fields - Extend persistInstructionFiles to also discover and persist skills - Add skillsFromParts() to reconstruct skill index from persisted parts - Update runChat() to use skillsFromParts on subsequent turns - Frontend: handle new `skill` part type (skip rendering, hide metadata-only messages)
66eeef0 to
cdaa25f
Compare
ibetitsmike
approved these changes
Mar 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Skills are now discovered once on the first turn (or when the workspace agent changes) and persisted as
skillmessage parts alongsidecontext-fileparts. On subsequent turns, the skill index is reconstructed from persisted parts instead of re-dialing the workspace agent.This makes skills consistent with the AGENTS.md pattern and is groundwork for a future
/contextendpoint that surfaces loaded workspace context to the frontend.Changes
skillChatMessagePartTypewithSkillNameandSkillDescriptionfieldspersistInstructionFilesto also discover and persist skills as partsskillsFromParts()to reconstruct skill index from persisted parts on subsequent turnsrunChat()to useskillsFromPartsinstead of re-dialing workspace for skillsskillpart type (skip rendering, hide metadata-only messages)Before / After
context-fileparts, reconstruct from partsskillsCacheonly, re-dial workspace on cache misscontext-fileparts, reconstruct from partsskillparts, reconstruct from partsThe in-memory
skillsCacheremains forread_skill/read_skill_filetool calls that need full skill bodies on demand.Design context
This is the first step toward a unified workspace context representation. Currently:
Persisting skills as parts means a future
/contextendpoint can query both context files and skills from the same message parts in the DB, without depending on ephemeral server-side caches.