# Takeover verification

Target: [#21092](https://git.cafe/pingdotgg/t3code/pulls/21092), original contribution by @AnobleSCM.

Reviewed head: d2e91b8d22f60495b5cc9ae73402315d9bba1bdc. Base: eea989536849e5b5049987ee24318b5a77326542.

## Tests

ProviderEventIngestor.test.ts: main 23 cases, original PR 28 cases, takeover 28 cases. Existing secondary model-selection case strengthened; five added cases cover plain and guarded lock recovery, exhaustion, and unrelated error rejection. All 28 pass with the fix. Removing the production change gives 4 failed, 24 passed. Increasing retry limit fails the exhaustion case; retrying every error fails the unrelated-error case. Server typecheck and scoped lint pass.

## Independent review round 1

GPT-6.1 Sol / Codex: MERGE, no blocking findings. Checked full diff, scoped tests, real-SQLite classification test, server typecheck and lint. Existing shared thread lock resolves the historical stale-thread normalization objection. No sensitive semantics or contract changes.

Claude Opus 5.5 / Claude Agent: MERGE, no blocking findings. Checked full diff, 28 tests and server typecheck. Noted synchronous busy waits can total approximately 15 seconds, plus queueing, under sustained contention; thread command lock remains held where already used.

## Scope and limits

Only provider-event ingestion writes retry, including secondary native-subagent model selection. Turn-start writes, general failed-COMMIT recovery, indefinitely held locks, and orphaned-provider cleanup are outside scope. The warning-only branch metadata followup is unchanged. No UI paths, auth, credentials, permissions, approval decisions, modes, sandbox, trust or MCP changes. No regex/parser/input loops added. No dependency patches.

No browser, desktop or mobile capture is applicable to this server-only diff. Runtime evidence is separately linked.

Models/harnesses: Claude Opus 5.5 through Claude Agent for tests and implementation; independent GPT-6.1 Sol/Codex and Claude Opus 5.5/Claude Agent reviewers; GPT-6.1 Sol/Codex proof and runtime evidence.
