fix(recovery): persist job-missing invocation evidence (BLO-18106) - #1048
fix(recovery): persist job-missing invocation evidence (BLO-18106)#1048allyblockcast[bot] wants to merge 12 commits into
Conversation
1 similar comment
|
@ally please review PR #1048 (BLO-19889). Review focus:
|
|
Hey @allyblockcast[bot]! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Critical Issues (1)
Important Issues (1)
Strengths
Recommended Action
This PR is authored by |
|
Addressed both findings at head
I am not requesting Ally again because this PR is authored by the Ally GitHub App and cannot receive an App self-review. The exact head needs an independent-author replacement before an Ally approval can exist. |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (2)
Important Issues (1)
Strengths
Recommended Action
This PR is authored by |
|
Addressed the current-head finding in
Local verification: continuation/retry suites |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (1)
Critical Issues (1)
Suggestions (1)
Strengths
Recommended Action
This PR is authored by |
kkroo
left a comment
There was a problem hiding this comment.
Reviewed the recovery changes. The final behavior keeps ambiguous k8s_pod_schedule_failed/job_missing on the fail-safe no-retry path, persists adapterInvocationStarted evidence for missing Jobs, and preserves process_lost as the bounded retry path for work that provably never started. Focused classifier tests pass locally and server typecheck is clean; embedded Postgres suites are skipped in this local environment and are left to CI.
|
@ally please re-review head f9ab2b8. Focus on the continuation and automatic retry gates for |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (1)
Critical Issues (1)
Important Issues (2)
Strengths
Recommended Action
This PR is authored by |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (3)
Critical Issues (1)
Important Issues (2)
Strengths
Recommended Action
This PR is authored by |
|
@ally please re-review head 0b19409. Focus on the prior current-head findings: accepted-interaction continuation now classifies only the matching interaction run and blocks non-retryable outcomes without deliverable replay; todo/review-participant escalation respects newer operator unblocks; and cross-agent review-participant escalation persists |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (3)
Critical Issues (2)
Important Issues (1)
Strengths
Recommended Action
This PR is authored by |
|
Addressed the current-head review findings in
Verification: six changed integration cases pass; retry/classifier suites pass ( |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (3)
Critical Issues (1)
Important Issues (1)
Strengths
Recommended Action
This PR is authored by |
…get (BLO-19889) `k8s_pod_schedule_failed` means the agent pod never bound to a node, so the adapter was never invoked and no work product exists. It was not in TRANSIENT_INFRA_CONTINUATION_ERROR_CODES, so classifyContinuationFailure returned `default` (maxAttempts 1, no backoff) and the second consecutive failure hit escalateStrandedAssignedIssue — which both spends a stranded-recovery attempt and reassigns the issue up the org chain, for a cause no owner in that chain can act on. heartbeat.ts's shouldScheduleAutomaticRunRetry only re-queues this code for pr_review wakes, so an *issue* run had no retry engine at all. Same safety shape as `process_lost` (BLO-16182): bounded 3 attempts with 60s exponential backoff instead of instant escalate. `job_missing` is handled separately and evidence-gated: the external lifecycle Job can vanish *after* a non-idempotent side effect (BLO-18106), so it is treated as transient infra only when the reconciler durably proved `adapterInvocationStarted === false` — mirroring the existing `job_failed` gate. Missing or non-boolean evidence falls through to `default`. Work-class failures are unchanged and still escalate on the next attempt. Co-Authored-By: Claude <noreply@anthropic.com>
Keep k8s_pod_schedule_failed on the fail-safe default path because adapters may emit it after main-container execution. Persist adapter.invoke evidence when the missing-Job reconciler finalizes a run, and cover the real reaper record plus classifier controls. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
39599d0 to
c7617c3
Compare
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (2)
Critical Issues (1)
Important Issues (1)
Strengths
Recommended Action
This PR is authored by |
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
@ally please re-review head |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (2)
Critical Issues (0)Important Issues (1)
Suggestions (1)
Strengths
Recommended Action
This PR is authored by |
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
Addressed the current-head Ally findings in
|
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (1)
Critical Issues (0)Important Issues (3)
Strengths
Recommended Action
This PR is authored by |
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
@ally please re-review head
Verification: focused heartbeat regressions |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (3)
Critical Issues (0)Important Issues (3)
Suggestions (0)Strengths
Recommended Action
This PR is authored by |
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
@ally please re-review at head |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (3)
Critical Issues (0)Important Issues (2)
Suggestions (0)Strengths
Recommended Action
This PR is authored by |
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
@ally please re-review exact head |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (2)
Critical Issues (0)Important Issues (2)
Suggestions (0)Strengths
Recommended Action
This PR is authored by |
Thinking Path
Linked Issues or Issue Description
job_missingfinalizations did not persist the invocation evidence consumed by retry safety checks. Pre-invocation loss isprocess_lost; productionjob_missingrecords must remain fail-safe because invocation already started.job_missing adapterInvocationStarted k8s_pod_schedule_failedreturned only this PR.What Changed
externalLifecycleRecovery.adapterInvocationStartedfor reconciler-producedjob_missingrecords, matching the existingjob_failedpath.reapOrphanedRunsintegration fixture that production writestrueand does not schedule an automatic retry.job_missingon the default continuation path; pre-invocationprocess_lostremains the bounded transient retry path.job_missing.k8s_pod_schedule_failedoutcomes, which current adapters may emit after the main container starts.Verification
pnpm exec vitest run server/src/services/recovery/service.infra-class-continuation.test.ts server/src/__tests__/heartbeat-retry-scheduling.test.ts(53 passed)pnpm exec vitest run server/src/__tests__/heartbeat-process-recovery.test.ts -t "records that adapter invocation started"(1 passed,158 skipped)pnpm --filter @paperclipai/server typecheck(clean)Risks
Model Used
openai/gpt-5.6-sol, tool-enabled coding and test execution.Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template