GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: add chat automations management API behind chat-automations by ThomasK33 · Pull Request #30112 · coder/coder Conversation
Member
Adds the management API for chat automations under
PR 3b (stacked on this one) adds disable and re-enable with the queue cutoff, makes delete run disable first, and adds secret rotation and the schedule preview route. Until then, the queue promotion guard from #30096 discards queued rows whose automation was deleted. Dogfood UAT ran on a real dev instance and passed: create/list/get/patch/delete via curl, owner-only 403s for an organization admin and the site owner, the cap (including concurrent creates and cross-organization counting), a runtime rule turning the experiment off for one user without a restart, and Part of CODAGT-1209 (PR 3b closes it) Stack: PR 3 of the Automations for Coder Agents stack, on top of #30096 (which is on top of #30085).
Generated with
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Add the management API for chat automations under
/api/experimental/organizations/{organization}/chat-automations
(list, create, get, PATCH, delete). There is no /api/v2 alias.
- Register chat-automations as a user-scoped experiment (ExperimentsKnown,
ExperimentsUserScoped, and the ruleguard rule). Routes decide it per
caller through the experiment evaluator and return 404 when it is off,
including after a runtime rule change without a restart.
- Add --chat-max-automations-per-owner (default 50). Creating one more
automation than the cap, counted across all organizations, fails with
409.
- Add chatd CreateAutomation, UpdateAutomation, DeleteAutomation, and
AutomationNextRuns with per-field validation shared by create and
PATCH. Only the owner can PATCH; org admins and site owners can list,
get, and delete. Kind and target mode cannot change.
- Webhook secrets are returned only by create; only their SHA-256 hash
is stored.
- Add cron.Standard for general five-field specs in an IANA time zone.
- Add queries GetChatAutomationsByOrganizationID,
CountChatAutomationsByOwnerID, and UpdateChatAutomationByID with
dbauthz, SDK types, and experimental client methods.
Refs CODAGT-1209, CODAGT-1217
Add a chatAutomationResponse helper for the four handlers that convert a row with its upcoming runs, and drop a redundant deleted check on model configs: GetChatModelConfigByID already filters deleted rows. Signed-off-by: Thomas Kosiewski <[email protected]> …rectly Strengthen the chat automation route tests where assertions passed for the wrong reason or left branches unexercised: - Compare the stored webhook secret hash with an independent SHA-256 of the returned secret instead of only checking the plaintext is absent. - Create as the site owner, who can read the member's chat and a model config in another organization, so the ownership and organization checks are reached instead of the lookup denial. - Assert an automation is not found under another organization's path. - Assert a prompt change bumps schedule_revision. The 409 for the per-owner cap no longer repeats wrapped internal errors; it states the configured limit. Document that restricting both day fields matches either one, as in standard cron. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…guard' into tk/codagt-1209-automations-mgmt-routes
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: c1e1686cd8
Your 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".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
An empty reasoning_effort in PATCH clears the override, so new chats use the model default again. Before, null was ignored and an empty string was rejected, so the override could not be removed. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Readiness record (agent): ready, with follow-ups tracked.
Generated with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…dagt-1209-automations-mgmt-routes codersdk/deployment.go conflicted where main added the chat-board and chat-stage-metrics experiments next to chat-automations. The resolution keeps all three in the Experiment constants, DisplayName and ExperimentsKnown, with main's entries first. Generated files (apidoc, API schema docs, typesGenerated.ts) were regenerated with make gen instead of being merged by hand. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
sync with main d9c13dc: hand-resolved codersdk/deployment.go (kept main's chat-board and chat-stage-metrics experiments plus chat-automations); generated apidoc/schemas/typesGenerated regenerated with make gen
Generated with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@codex review Scope: only the conflict resolution in merge commit 3f4cd08 (sync with main d9c13dc). Please do not re-review main's code or the unchanged stack code.
Generated with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. 👍 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". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…dagt-1209-automations-mgmt-routes No conflicts. make gen produced no diff. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
sync with main 35abc22: no content conflicts; make gen produced no diff
Generated with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Xum (an AI coding agent) prepared and posted this review on behalf of Mike. Each finding came from automated review passes and was re-verified against the code; please push back on anything that looks wrong.
The management service and routes match the CODAGT-1209 part 1 scope. The experiment gate fails closed, PATCH is owner-only, the cap uses a per-owner advisory lock, only the secret hash is stored, and the earlier Codex thread on clearing reasoning_effort is fixed. One small naming nit remains.
Verdict: no blocking issues
Severity: P0 0, P1 0, P2 0, P3 1
site/src/api/typesGenerated.ts only): FE2 PASS, FE1 and FE3 to FE10 N/A.httpapi.Read limit as postChatMessages, so it is not a new gap. Pagination of the list route and the cap message when the flag is 0 are not raised. The other deferred hardening items are tracked in CODAGT-1226.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| // Work computed from an older prompt or schedule is stale once | ||
| // either changes. | ||
| scheduleChanged := false |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
P3: scheduleChanged is also set by prompt edits
This flag becomes true when only the prompt changes (line 309) and then drives the ScheduleRevision bump at line 384. Someone reading line 384 will assume prompt edits leave pending scheduled work alone, but they invalidate it. The comment above the declaration explains this; the name does not. The code is unchanged through the top of the stack.
Fix: Rename it to something like revisionChanged or invalidatesPendingRuns at lines 297, 309, 332 and 384.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…dagt-1209-automations-mgmt-routes No conflicts. make gen produced no diff. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…gRuns A prompt edit also sets the flag, and it drives the schedule revision bump that invalidates pending scheduled work, so name it for that. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
sync with main d11809f: merged #30096; renamed scheduleChanged to invalidatesPendingRuns (Mike's review)
Generated with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Xum re-reviewed this PR on behalf of @ibetitsmike using GPT-6.1 Sol (high) Exec subagents.
Verified the four-use invalidation rename and preserved reasoning-effort clearing; the naming thread is fixed in source with an author reply but remains open on GitHub. New findings: Standards 0, Spec 0, Frontend 0, with no duplicate inline comments. Fresh targeted management/gating, queue-guard/locking, capacity and repeated concurrency tests passed, and generated contracts match. Storybook CI failed on Pixel snapshot-reporting HTTP 500, leaving visual validation incomplete; full suites, local frontend typecheck and remote UAT were not run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…dagt-1209-automations-mgmt-routes
Resolved conflicts:
- coderd/coderd.go: kept this layer's /organizations/{organization}/chat-automations
route group and main's new /organizations/{organization} group that mounts the
chat projects routes. Chi matches the static chat-automations segment first,
so both route groups stay reachable.
- dbauthz_test.go: kept both sides.
- Generated apidoc and API docs were regenerated with make gen.
---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
sync with main a328bee: merged #30096 (kept the chat-automations route group next to main's new organization chat routes)
Generated with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Xum validated this PR and approved it on behalf of @ibetitsmike.
Validated head e022601d5730. The naming and reasoning-effort fixes remain intact, and the restack preserves the management contracts. Fresh management/gating, queue/provenance/locking and interruption tests plus generated-contract checks passed. Current required CI passed. Accepted management and downstream follow-ups remain unchanged.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…dagt-1209-automations-mgmt-routes No conflicts. make gen regenerated docs/admin/setup/configuration-reference.md: main's new configuration reference generator now also lists this layer's chat max-automations-per-owner option in its format. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
merged #30096 (regenerated main's new configuration reference for this layer's option)
Generated with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Xum reviewed this PR on behalf of @ibetitsmike.
One newly reproduced integration finding blocks approval at ecc2bacdd3e4. Original accepted follow-ups remain unchanged. No source fix was applied.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ExperimentEnableAIWorkspaceDebug, | ||
| ExperimentChatBoard, | ||
| ExperimentChatStageMetrics, | ||
| ExperimentChatAutomations, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
P2: Extend the display-name test map for the new experiment
This adds the twentieth known experiment, but TestExperimentDisplayNames still expects only the inherited 19 entries. Both current Ubuntu and PG17 CI jobs fail at codersdk/deployment_test.go:61; the exact uncached test fails locally too. Add codersdk.ExperimentChatAutomations: "Chat Automations" to that existing expected map. A scratch-only one-entry overlay makes the test pass; the production display-name mapping is already correct.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Main's TestExperimentDisplayNames requires an expected display name for every known experiment. This layer adds chat-automations as the twentieth, so the expected map now includes it. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
fix: TestExperimentDisplayNames now expects the Chat Automations display name (Mike's P2; main's new test)
Generated with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Xum validated this PR and approved it on behalf of @ibetitsmike.
The missing ExperimentChatAutomations display-name expectation is fixed at ee760de9c8d36910a88d6aa738a47583a88cdea6. Fresh uncached tests pass for display names, chat-limit validation, safe experiments, and user-scoped experiment rules: four roots and 39 test/parent outcomes, with no skips.
The remaining 33 own-file blobs and patch payloads, base, and PR body are unchanged from the completed review. Prior management/runtime validation and independent Standards, Spec, and generated-FE dispositions are retained for that unchanged source, not reported as newly executed checks. Accepted deferrals remain accepted.
Current exact-head required CI and all observed checks passed at the approval gate. This is a layer-local approval, not approval of the whole stack; the lower #30096 CI race failure and outstanding upper-layer review issues are not waived. No full local SDK/repository suite, new runtime/race suite, lint/generation, UI/Pixel, or remote UAT was run for this test-only fix.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…dagt-1209-automations-mgmt-routes No conflicts. make gen produced no diff. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Generated with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ations-mgmt-routes Brings main ff158c0 into this layer. No conflicts. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.