Repository navigation
Keep control-plane state correct when a write or a restart fails - #293
Protonmatter wants to merge 1 commit into
Conversation
Queue an activity that could not be stored and tell the live stream the step failed. Rebuild spend caps from llm_usage, reject sessions issued before a password change, and wait for task goroutines on shutdown. A failed password read no longer mints a setup token, a coverage-flag error leaves tools available, and JSON bodies, login eviction, circuit-breaker writes, and MITM passthrough no longer fail open forever.
BaaRai
left a comment
There was a problem hiding this comment.
Thanks for the work. Two blockers before any code review:
- The branch conflicts with main in
db/migrate_test.go. 0005_activity_outbox.sqlcollides with0005_traffic_rewrite_rules.sql, which is already on main. With both present,loadMigrationsfails ("migration version 0005 is used by both"), and the binary cannot open any database. Please renumber the outbox migration to0006_activity_outbox.sqland rebase on current main.
Please also split the PR: it bundles several independent changes (auth, shutdown drain and outbox, budget caps, coverage flag, llmpool write queue, MITM passthrough TTL, JSON body cap). Two questions for the budget and shutdown parts: TaskLLMSpend counts every llm_usage row while the task ledger previously counted planner rounds only, so is the turn cap meant to change after a restart? And does cancelling task contexts in Engine.Wait persist a terminal status that would stop restoreTaskRuntimes from resuming those tasks?
|
Rebased onto current main. The bundle is split:
Turn cap. The live ledger does not count planner rounds only.
Shutdown. The intent claim was the hole. Closing this PR in favor of the seven above. |
Queue an activity that could not be stored and tell the live stream the step failed. Rebuild spend caps from llm_usage, reject sessions issued before a password change, and wait for task goroutines on shutdown. A failed password read no longer mints a setup token, a coverage-flag error leaves tools available, and JSON bodies, login eviction, circuit-breaker writes, and MITM passthrough no longer fail open forever.