Skip to content

feat(codersdk/workspacesdk): parse custom agent definition files - #31

Merged
ibetitsmike merged 2 commits into
mainfrom
mike/custom-agent-types-1-parser
Nov 9, 2026
Merged

ibetitsmike merged 2 commits into
mainfrom
mike/custom-agent-types-1-parser

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #7 (first PR of the custom agent types stack).

Adds workspacesdk.ParseAgentDefinition, which parses a Claude Code or Cursor agent markdown file (YAML front-matter plus a prompt body) into an AgentDefinition: name, description, prompt, model, reasoning effort, tool allow and deny lists, readonly, MCP mode, and base type (general or explore).

  • A file without front-matter returns ErrNotAgentDefinition, so a README in an agents/ directory is skipped rather than reported as broken.
  • Unknown keys become sorted warnings; is_background and color are dropped silently. Known keys with the wrong type, a non-kebab-case name, or an empty body are errors.
  • The name falls back to the file name. HTML comments are stripped from the body.
  • Claude Code's effort is accepted as an alias of reasoning_effort (which wins when both are set). Claude Code's mcpServers keeps the inherited MCP servers, matching Claude Code, where it only adds servers; the Coder mcp key (inherit, none, or a list of names) restricts them.

This PR has no runtime caller. The next PR wires it into workspace agent discovery, and the dogfood UAT for that PR exercises this parser end to end against real pstack definitions (poteto-agent, comment-sicko).

Validation: go test ./codersdk/workspacesdk/, go vet, gofmt.

@ibetitsmike

ibetitsmike commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner Author

Xum posted this on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T07:24:13.754191Z 5106aaf Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f6737fdb98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ted MCP servers

Claude Code names the reasoning level `effort`; accept it, with
`reasoning_effort` taking precedence. Claude Code's `mcpServers` adds servers
to the inherited set instead of restricting it, so it no longer switches the
definition to a named allowlist.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum posted this on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 5106aafdcf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit 5598133 into main Nov 9, 2026
10 checks passed
@ibetitsmike
ibetitsmike deleted the mike/custom-agent-types-1-parser branch November 9, 2026 08:53
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merged after checking the exact head 5106aaf: fork-ci green, Codex clean on 5106aaf, 0 unresolved threads. UAT round 1 (on 8071f13, which contains f6737fd) passed every parser criterion; its one defect was in the follow-up discovery PR. This PR adds a library with no runtime caller yet, so the deploy does not change behavior. The 5106aaf parser change has unit tests and is smoke-tested by round 2, which gates the discovery PR.

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