Repository navigation
docs: describe the chat configuration API operations and parameters - #31533
Closed
nickvigilante wants to merge 1 commit into
Closed
nickvigilante wants to merge 1 commit into
nickvigilante wants to merge 1 commit into
Conversation
The REST API reference renders these routes from swagger.json, and they had no description. Part of DOCS-1439. Assisted-by: AI
Collaborator
Author
|
Combined into #31562, where this PR's changes are the commit Generated by Coder Agents on behalf of @nickvigilante. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Describes the 22 chat configuration routes under
/api/v2/chats/configand the organization chat routes (system prompt and models), and improves the 15 parameters on them.The REST API reference renders these routes from
swagger.json, and they had no description.Merge notes
This PR doesn't touch #31473's exemption lists.
If #31473 merges first,
TestEndpointsDocumentednames each route on this PR to remove from those lists.Verification
The
swagger.jsondiff againstorigin/mainchanges onlydescriptionvalues on the 22 operations in scope: 22 descriptions added and 15 parameter descriptions rewritten.The route list regenerated from
5c691c82c9is identical to the shared one.Claims checked against the code
GET,PUT /api/v2/chats/config/system-promptcoderd/exp_chats.go:5172,coderd/exp_chats.go:5226,coderd/rbac/roles.go:414(Owner gets all site permissions except the listed ones)GET,PUT /api/v2/chats/config/plan-mode-instructionscoderd/exp_chats.go:5449,coderd/exp_chats.go:5498,coderd/database/dbauthz/dbauthz.go:3809GET /api/v2/chats/config/personal-model-overrides,GET /api/v2/chats/config/debug-loggingcoderd/exp_chats.go:5766,coderd/exp_chats.go:6188,coderd/rbac/roles.go:479,coderd/rbac/roles.go:495PUT /api/v2/chats/config/personal-model-overrides,debug-logging,debug-retention-days,auto-archive-days,workspace-ttlcoderd/exp_chats.go:5900(putChatOperationalSetting)GET /api/v2/chats/config/auto-archive-days,debug-retention-days,workspace-ttlcoderd/database/dbauthz/dbauthz.go:3352,coderd/database/dbauthz/dbauthz.go:3385,coderd/database/dbauthz/dbauthz.go:3999/api/v2/chats/config/auto-archive-days0disables auto-archive, maximum3650days, the unit is days of chat inactivitycodersdk/chats.go:1567,coderd/exp_chats.go:6617,coderd/x/chatd/auto_archive.go:68/api/v2/chats/config/debug-retention-days30,0disables the cleanup, maximum3650dayscodersdk/chats.go:1572,coderd/exp_chats.go:6558,coderd/database/dbpurge/dbpurge.go:328/api/v2/chats/config/workspace-ttl0means off and the template's autostop applies, accepted range is0or 1 minute to 30 days, the value goes on workspaces that chats createcodersdk/chats.go:1578,coderd/exp_chats.go:6463,coderd/exp_chats.go:6469,coderd/x/chatd/chattool/createworkspace.go:193PUT /api/v2/chats/config/debug-logging--chat-debug-logging-enabledforces logging oncoderd/exp_chats.go:6289,coderd/exp_chats.go:6203(ForcedByDeployment)PUT /api/v2/chats/config/user-debug-logging403unless an administrator enabled user opt-in,409while the deployment forces logging oncoderd/exp_chats.go:6289,coderd/exp_chats.go:6304GET,PUT /api/v2/chats/config/user-promptcoderd/exp_chats.go:6655,coderd/exp_chats.go:6690,coderd/database/dbauthz/dbauthz.go:5595,coderd/database/dbauthz/dbauthz.go:8851,coderd/x/chatd/chatd.go:2072PUTsystem prompt, plan mode instructions,user-prompt, organization system promptCODER_CHAT_MAX_PROMPT_BYTESlimits their sizecodersdk/deployment.go:4526,coderd/exp_chats.go:7903/api/v2/chats/config/system-promptinclude_default_system_promptdecides whether it is included, and omitting it keeps the current valuecoderd/exp_chats.go:5271,coderd/exp_chats.go:5286,coderd/x/chatd/chatd.go:2030GET,PUT /api/v2/organizations/{organization}/chats/config/system-promptcoderd/x/chatd/chatd.go:2057GET /api/v2/organizations/{organization}/chats/config/system-promptcoderd/exp_chats.go:5333,coderd/database/dbauthz/dbauthz.go:3790,coderd/rbac/roles.go:496,coderd/rbac/roles.go:601,coderd/rbac/roles.go:634PUT /api/v2/organizations/{organization}/chats/config/system-promptcoderd/exp_chats.go:5378,coderd/database/dbauthz/dbauthz.go:9611,coderd/rbac/roles.go:601GET /api/v2/organizations/{organization}/chats/modelscoder:allorchat_model_config:readcoderd/exp_chats.go:8330GET /api/v2/organizations/{organization}/chats/modelscoderd/database/dbauthz/dbauthz.go:3731GET /api/v2/organizations/{organization}/chats/modelscoderd/exp_chats.go:8256(chatModelProviderDescriptors,availability)POST /api/v2/organizations/{organization}/chats/modelscoderd/database/dbauthz/dbauthz.go:6557,coderd/rbac/roles.go:601POST /api/v2/organizations/{organization}/chats/modelsai_provider_id,model, and a positivecontext_limitare required, the provider must exist and be enabledcoderd/exp_chats.go:8657,coderd/exp_chats.go:8690,codersdk/chats.go:1963{organization}routesdefaultcoderd/httpmw/organizationparam.go(ExtractOrganizationParam),coderd/coderd.go:1569doc-check self-check
Mode: author self-check on the branch diff.
Nothing was posted to GitHub.
The deterministic checks passed:
make lint/emdash,check_routes.pywithproblems=0, and the swagger tests.coderd/rbac/roles.go. No findings.word-choice.md.shared_params.py. Theorganizationpath wording matches the shared text the other branches use, and no route here usesuser,limit,offset, orafter_id. "Coder Agents" names the product and "chat" names the object throughout. No findings.1 minute. The rule covers Markdown source underdocs/, and in an annotation would render as literal text inswagger.json. The other was a style preference with no rule behind it (the "toggle" wording in the user debug logging description), which never blocks.Writing rules applied
Authorizecall ordbauthzmethod andcoderd/rbac/roles.go.RequireFeatureMWor an experiment.{organization}copied from the brief where the route usesExtractOrganizationParam.word-choice.md.CI flakes unrelated to this change
test-go-pg (windows-2022)failedTestAPISessionRecoveryWriteDeadline/messageinagent/x/agentacp, a package this PR doesn't touch: https://github.com/coder/coder/actions/runs/40926600877/job/123633878773Part of DOCS-1439.
Generated by Coder Agents on behalf of @nickvigilante.