refactor: rename coderd_chat_system_prompt to coderd_agents_system_prompt - #425
Merged
Merged
Conversation
…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.
bpmct
approved these changes
Aug 25, 2026
Member
|
@codex review The original resource hasn't been included in any release, and so hasn't been adopted by any users |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
approved these changes
Aug 25, 2026
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.
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.
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_servercoderd_agents_modelcoderd_default_agents_model#412 landed
coderd_chat_system_prompt, which is also an Agents-area resource (Settings → Instructions) but uses achat_prefix. Since the resource is unreleased (last tagv0.0.23predates #412), we can rename it cleanly before it ships.What changed
coderd_chat_system_prompt→coderd_agents_system_prompt.internal/provider/chat_system_prompt_resource{,_test}.go,docs/resources/chat_system_prompt.md,examples/resources/coderd_chat_system_prompt/→coderd_agents_system_prompt/.ChatSystemPromptResource→AgentsSystemPromptResource,chatSystemPromptTextValue→agentsSystemPromptTextValue, test helpers, etc.).TypeNameinMetadata()updated.import.sh, and generated docs toagents_system_prompt(the value itself is ignored byImportState; only the string in user-facing guidance changes).AGENTS.md: added a short Naming note under "Adding a new resource" describing thecoderd_<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.UpdateChatSystemPromptcodersdk.ChatSystemPromptResponse,codersdk.UpdateChatSystemPromptRequest/api/experimental/chats/config/system-promptRenaming 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.mdregenerated cleanly; no drift against other resources.TF_ACC=1acceptance 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_promptin a real config yet. If any pre-release users have adopted it, they'll need to change the resource type and re-runterraform init— no state migration is provided.Requested on behalf of @matifali.