Repository navigation
android: fix 409 idempotency_in_flight key drop and unify failure classification - #902
sambitcreate wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Caution
This PR still introduces a key-drop path for unreadable 409 responses, so retrying can duplicate a Bot or scheduled mutation.
Reviewed changes I reviewed the complete Android failure-classification and durable-mutation change against the corresponding transport, host ledger, controller, and mobile contract behavior.
- Shared failure policies — Adds endpoint-specific ambiguity rules for before-effect refusals, cached durable-ledger rejections, and strict fork/new-worktree replay contracts.
- Durable Bot controllers — Reuses one sticky-uncertainty and retry-window helper across Open Work, Peers, Resume, Routine Models, and Watches, including the first-attempt
409 idempotency_in_flightfix. - Keyed actions — Moves Bot create/session actions, scheduled run-now, fork/continue, avatar, and new-worktree key settlement onto the shared classifier.
- Storage handling and tests — Preserves Open Work and Peer Stop storage failures and expands behavioral coverage for same-key replay, unknown conflicts, definite refusals, and failed journal clears.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes I reviewed the malformed-error-envelope fix added since the prior Pullfrog review and rechecked it against the complete Android transport and idempotency-settlement diff.
- Envelope provenance — Preserved whether an HTTP error envelope was genuinely decoded instead of letting synthetic
internal_errorbodies masquerade as structured rejections. - Settlement safeguards — Required decoded envelopes before clearing keys or applying code-specific behavior, while retaining the intentional strict new-worktree handling for unreadable non-409 answers.
- Regression coverage — Added parser, classifier, controller, and real HTTP tests that verify malformed 409 responses retain and replay the original scheduled-run, Bot action, and Resume keys.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

Summary
409 idempotency_in_flightkey-drop bug inAidenBotOpenWorkController.ktand unify Android failure-ambiguity classifiers intoprotocol/AidenRemoteFailureClassification.ktacross Bot, Schedule, Fork, and Worktree controllersfeatures/bots/AidenDurablePendingMutation.ktacross the 5 durable pending-mutation Bot controllers and fix twoSTORAGE-masking bugs inOpenWorkandPeersAidenRemoteFailureClassificationTest.ktand expand controller unit testsVerification
./gradlew :app:testDebugUnitTest(120 suites, 1,407 tests passed) and./gradlew :app:assembleDebug :app:compileDebugAndroidTestKotlin(passed);./gradlew :app:lintDebugrunning on CI (OOM'd locally on low-RAM Linux box)