Repository navigation
Conversation
Without Postgres, spent plan approvals lived in one process's memory, so a restart or a second replica accepted an approval that was already used. On /chat/stream and the apiserver, a text approval carries no message id, and it was refused on replay for only 7.5 to 15 minutes, then accepted again against a re-plan of the same manifests. Key changes: - Leave resources_plan and resources_apply out when no approval store is configured; deployments without Postgres keep resources_validate only. - Spend text approvals in a permanent ledger record that pruning never removes; without a message id, each approval code works once per conversation. - When a spent code is refused, tell the model to ask for approval by the new plan's token, which differs on every re-plan. - Add a permanent column to assistant_exec_approvals; plan card and exec approvals keep the one-day retention, longer than any token they carry.
ecv
marked this pull request as ready for review
November 17, 2026 15:25
ecv
enabled auto-merge
November 17, 2026 15:25
ecv
disabled auto-merge
November 17, 2026 15:26
ecv
marked this pull request as draft
November 17, 2026 15:26
andrewb3000
approved these changes
Nov 17, 2026
andrewb3000
left a comment
There was a problem hiding this comment.
Non-blocking
internal/execapproval/postgres.go:61: Rolling back to the previous image brings back its prune, which ignorespermanent. Text approvals older than a day would then be deleted and could be replayed again. Note this in the release notes or the runbook.internal/execapproval/postgres.go:59: Permanent rows are never pruned, so the table grows by one row per typed approval forever. That is small today, but consider a long cap, such as a year, or a follow-up issue.
Checked
internal/agentwiring/wiring.go:277: Checked the wiring. The only agent.New caller passes the Postgres store whenever CONVERSATION_STORE_URL is set. config/base/assistant.yaml and the production overlay both set that variable, so deployed assistants keep plan and apply. Only local runs without a database lose them.internal/execapproval/postgres.go:17: The ALTER TABLE ADD COLUMN IF NOT EXISTS with a constant default is metadata-only, and the table is pruned daily, so the brief exclusive lock is harmless. Concurrent replicas run it one after another. Old pods still insert with the default false during the rollout.
kevwilliams
approved these changes
Nov 17, 2026
kevwilliams
left a comment
Contributor
There was a problem hiding this comment.
Verified marking used is one atomic insert, errors refuse, and the replay test fails on main; with no database the apply tool is removed.
Contributor
Author
|
Superseded by #181, which merged on 18 Nov. It keys each spent approval to a code the server derives from the verified plan, so no conversation or message id from the client can make an approval fresh again. That closes the replay this PR targeted. |
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.
Summary
A used plan approval could apply a change again after a restart, on a second replica, or 15 minutes later in the streaming chat and API; now it is refused at any age. An assistant with no database to record approvals no longer offers to plan or apply changes, only to validate them.
Fixes #178
Warning
In the streaming chat and API, each approval code works once per conversation, so re-approving after a failed apply needs the new plan's token or the plan card.
Test plan