Skip to content

refactor: rename coderd_chat_system_prompt to coderd_agents_system_prompt - #425

Merged
ethanndickson merged 1 commit into
mainfrom
blink/rename-chat-system-prompt-to-agents
Aug 25, 2026
Merged

refactor: rename coderd_chat_system_prompt to coderd_agents_system_prompt#425
ethanndickson merged 1 commit into
mainfrom
blink/rename-chat-system-prompt-to-agents

Conversation

@blinkagent

@blinkagent blinkagent Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Renames the deployment-wide chat system prompt resource introduced in #412 so it fits the coderd_agents_* naming used by the other Coder Agents feature-area resources.

Motivation

The existing Agents-related resources are all prefixed with agents_:

  • coderd_agents_mcp_server
  • coderd_agents_model
  • coderd_default_agents_model

#412 landed coderd_chat_system_prompt, which is also an Agents-area resource (Settings → Instructions) but uses a chat_ prefix. Since the resource is unreleased (last tag v0.0.23 predates #412), we can rename it cleanly before it ships.

What changed

  • Resource type: coderd_chat_system_promptcoderd_agents_system_prompt.
  • Files renamed: internal/provider/chat_system_prompt_resource{,_test}.go, docs/resources/chat_system_prompt.md, examples/resources/coderd_chat_system_prompt/coderd_agents_system_prompt/.
  • Local Go identifiers renamed to match (ChatSystemPromptResourceAgentsSystemPromptResource, chatSystemPromptTextValueagentsSystemPromptTextValue, test helpers, etc.). TypeName in Metadata() updated.
  • Import ID placeholder updated in the diagnostic messages, example import.sh, and generated docs to agents_system_prompt (the value itself is ignored by ImportState; only the string in user-facing guidance changes).
  • AGENTS.md: added a short Naming note under "Adding a new resource" describing the coderd_<feature-area>_* convention.

What is intentionally not renamed

These identifiers live in codersdk (owned by coder/coder) and describe the API surface, not the Terraform-provider surface. They're preserved as-is:

  • codersdk.GetChatSystemPrompt, codersdk.UpdateChatSystemPrompt
  • codersdk.ChatSystemPromptResponse, codersdk.UpdateChatSystemPromptRequest
  • The endpoint /api/experimental/chats/config/system-prompt
  • User-facing prose that describes the feature ("chat system prompt") in schema/diagnostics matches how it appears in the Coder API and dashboard.

Renaming those would be a separate change in coder/coder.

Testing

  • make build — clean.
  • go vet ./... — clean.
  • gofmt -l ./internal/provider/ — clean.
  • go test ./internal/provider/... -run 'TestAgentsSystemPrompt' -count=1 — pass (TestAgentsSystemPromptSemanticEquals, TestAgentsSystemPromptLengthValidator, TestAgentsSystemPromptModifyPlan).
  • go generate (tfplugindocs) — docs/resources/agents_system_prompt.md regenerated cleanly; no drift against other resources.
  • TF_ACC=1 acceptance tests not run here (require a Coder deployment); please trigger CI to exercise them.

Breaking change note

Because the resource has not appeared in a released provider version, no user should have coderd_chat_system_prompt in a real config yet. If any pre-release users have adopted it, they'll need to change the resource type and re-run terraform init — no state migration is provided.

Requested on behalf of @matifali.

…ompt

All Coder Agents feature-area resources are named coderd_agents_*
(coderd_agents_mcp_server, coderd_agents_model, coderd_default_agents_model).
Rename coderd_chat_system_prompt to coderd_agents_system_prompt for
consistency before the resource ships in a provider release.

- Rename the resource type, Go types, and files (resource + tests, docs,
  example directory).
- Update the import-ID placeholder in diagnostics/docs/example to match
  the new name (the value is ignored by ImportState, only the string in
  user-facing guidance changes).
- Preserve the SDK identifiers under codersdk (GetChatSystemPrompt,
  UpdateChatSystemPrompt, ChatSystemPromptResponse,
  UpdateChatSystemPromptRequest) and the underlying API path, which are
  owned by coder/coder and not changed here.
- Document the coderd_<feature-area>_* naming convention in AGENTS.md
  so future resources land in the right family.
@ethanndickson

Copy link
Copy Markdown
Member

@codex review

The original resource hasn't been included in any release, and so hasn't been adopted by any users

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: e9726ece05

ℹ️ 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".

@ethanndickson
ethanndickson merged commit 0698f5f into main Aug 25, 2026
14 checks passed
@ethanndickson
ethanndickson deleted the blink/rename-chat-system-prompt-to-agents branch August 25, 2026 13:55
matifali added a commit that referenced this pull request Aug 25, 2026
Add per-resource tfplugindocs templates (templates/resources/<name>.md.tmpl,
templates/data-sources/<name>.md.tmpl) that set a subcategory
front-matter field per resource/data source, so the Terraform Registry
sidebar groups coderd_* pages into Agents, AI Governance, Deployment,
Identity & Access Management, and Templates instead of listing them flat.

The templates are copies of tfplugindocs' default resource template,
minus the HasImportIDConfig/HasImportIdentityConfig branches: no
resource ships import-by-string-id.tf or import-by-identity.tf example
files, so those branches were always-false dead code. Data-source
templates drop the import section entirely.

Stacked on org-chat-models/default-model (#423): templates cover the
renamed coderd_agents_default_model and this base's
coderd_chat_system_prompt; when the stack rebases past #425, rename
templates/resources/chat_system_prompt.md.tmpl to
agents_system_prompt.md.tmpl.

Regenerated docs/ with make gen; only the subcategory line changed per
file.
ethanndickson pushed a commit that referenced this pull request Aug 26, 2026
Add per-resource tfplugindocs templates (templates/resources/<name>.md.tmpl,
templates/data-sources/<name>.md.tmpl) that set a subcategory
front-matter field per resource/data source, so the Terraform Registry
sidebar groups coderd_* pages into Agents, AI Governance, Deployment,
Identity & Access Management, and Templates instead of listing them flat.

The templates are copies of tfplugindocs' default resource template,
minus the HasImportIDConfig/HasImportIdentityConfig branches: no
resource ships import-by-string-id.tf or import-by-identity.tf example
files, so those branches were always-false dead code. Data-source
templates drop the import section entirely.

Stacked on org-chat-models/default-model (#423): templates cover the
renamed coderd_agents_default_model and this base's
coderd_chat_system_prompt; when the stack rebases past #425, rename
templates/resources/chat_system_prompt.md.tmpl to
agents_system_prompt.md.tmpl.

Regenerated docs/ with make gen; only the subcategory line changed per
file.
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.

3 participants