Repository navigation
fix: save api runs with no key instead of crashing; race-safe migrations - #159
Merged
Merged
Conversation
'secfoo run --agent api' with no API key ended in an IntegrityError traceback: the adapter returns status 'not_configured' (added in 7216d34) but runs.status's CHECK constraint never allowed it. The schema now does, and existing databases get the CHECK widened by a table rebuild that keeps column order, rows and references. Testing that migration under concurrent opens also exposed an existing upgrade bug: skills run in parallel threads with their own connections, so the first multi-skill run on an old database could race on ADD COLUMN and fail with 'duplicate column name'. A lost race is now treated as done. Also: an id wider than SQLite's INTEGER in a dashboard URL returned 500 (OverflowError); it is now a 404. Co-Authored-By: Claude Opus 5.5 <[email protected]>
vsn411
added a commit
that referenced
this pull request
Nov 20, 2026
…ink check tolerates GitHub 503s (#163) * fix: retry the WAL switch instead of failing parallel first opens Switching a database to WAL takes an exclusive lock, and SQLite returns 'database is locked' for it at once instead of honouring busy_timeout. Several skills opening a new or pre-WAL database at the same moment failed about 1 open in 20; the #159 concurrency test hit it intermittently. The switch now retries briefly. WAL persists in the file, so only the first open ever switches it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: do not fail the link check on github.com 503s github.com throttles blob pages crawled from Actions runners with 503, which turned main red twice on 2026-11-20 with 1 and 18 'errors' on pages that exist. A broken link is a 404, which still fails. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: retry store setup on 'database schema has changed' too CI (Python 3.10, Linux) showed parallel first opens of a new database can also fail with 'database schema has changed' while another connection creates the tables, not only with the WAL switch's 'database is locked'. Every setup step is idempotent, so the whole setup is now retried on a fresh connection for either error, until a 10-second deadline; any other error raises at once. Deterministic tests inject each error; the parallel stress test now prints the failing tracebacks. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Satyanarayana Vuppala <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Found during end-to-end testing before go-live.
Bugs
secfoo run --agent apiwith no API key crashed with a traceback. The api adapter returns statusnot_configured(added in 7216d34), but theruns.statusCHECK constraint was never widened, so saving the run raisedIntegrityError: CHECK constraint failed. This is the first thing a user without an agent CLI sees.duplicate column name. Skills run in parallel threads, each with its own connection, and every connection runs theADD COLUMNmigrations. On an old database two connections could both see a column missing. Found by the new concurrency test./assessments/99999999999999999999,OverflowError).Fix
schema.sqlallowsnot_configured._migrate_runs_status_checkwidens the CHECK on existing databases with SQLite's documented table rebuild:BEGIN IMMEDIATE, so concurrent opens migrate onceADD COLUMNrace as success.OverflowErrorto 404.Tests
tests/test_storage/test_run_status_migration.py:agents.base.Statussaves on a fresh schemaApiAdapterwith no key goes throughexecute_runstests/test_web/test_assessment_routes.py: oversized ids return 404.Four of the five new storage tests and two of the three new route tests fail on
main. Full suite: 1842 passed.🤖 Generated with Claude Code