Skip to content

fix(pusher): skip durable projection for purged conversations on NotFound - #24090

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/projfix
Oct 30, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/projfix

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Pusher durable projection: gone-owner no-op on NotFound + raising-frame attribution

Failure-Class: none

Line-Count-Exception: backend/routers/pusher.py | 1542 -> 1611 | NotFound gone-owner arm (deletion-intent read + drop without custody failure) and raising-frame attribution per lead ruling 2026-10-30 06:00Z

No existing failure class covers the pusher durable-projection surface; this
change stops a permanent gone-owner condition from being classified as a
transient projection failure (deterministic retry churn plus
failed_recordings poisoning at the 128-entry session cap). Adding a new
class definition would require .github/ changes, which are out of scope
for this PR.

What

  • flush_refs now catches NotFound before the generic projection handler.
    If the conversation is tombstoned (conversation_tombstones.is_deleted,
    the same read the custody write gate uses) or its conversation doc no
    longer exists, the purged refs drop as a gone-owner no-op: no
    record_barrier.fail_recording, no failed_recordings entry, no
    record_failure/record_fallback, no retry churn — one info line
    Durable audio projection skipped; conversation gone.
  • A live conversation keeps today's transient retry/terminal paths
    unchanged (NotFound on live audio is never hidden as a gone owner). The
    extra deletion-intent read runs only on the NotFound arm; if that read
    itself fails, the arm fails open to the transient path instead of
    propagating out of the drain loop.
  • The existing warning Durable audio projection failure class: %s now also
    names the innermost raising frame (walking exc.__traceback__ to the last
    frame, co_name only — never the message or args), so the unattributed
    InvalidArgument minority becomes diagnosable from logs without a redeploy.

Why

Read-only verdict (2026-10-30, swarm/state/refs/projfail-verdict-2026-10-30.md):
the dominant NotFound stream (~1,000 class lines/10m, ~460 conversations/h)
is read_pcm hitting objects purged by sanctioned conversation deletion
(user delete, merge, empty-recording cleanup) while the receipts still sit
in the pusher durable queue. Retries are deterministic (requeue:terminal
ratio 2.0 — retries rescue nothing), and every terminal conversation enters
failed_recordings, where the 128-entry session cap flips
record_upload_failed=True session-globally and can fail-mark later healthy
conversations of the same websocket session. Chronic since #23641; made
visible by #24084's class logging. No rollback indicated (attributed in the
verdict); this PR removes the churn and the poisoning path.

Tests

backend/tests/unit/test_audio_durable_outbox.py:

  • test_notfound_on_tombstoned_conversation_drops_refs_without_custody_failure
    — purged read + tombstone: refs dropped on the first NotFound (no
    requeue), zero custody failures, zero fail_recording (observed via
    mark_record_upload_failed), receipts still acked and readable.
  • test_notfound_on_hard_deleted_conversation_doc_drops_refs — tombstone
    false + missing conversation doc: same gone-owner no-op.
  • test_notfound_on_live_conversation_keeps_transient_retry_and_terminal_paths
    — live conversation: exactly 1 + PROJECTION_RETRY_BUDGET attempts, the
    terminal ('projection', 'transient') drop, record close withheld, and
    the class line attributes NotFound raised by purged_read with the
    exception message never logged.
  • Existing budget/conflict/retry tests updated for the new class-line
    format and a message-leak assertion.

Local verification (layer: backend unit suite, selected by the CI
changed-file selector for this diff — 34 files, all green):

BACKEND_UNIT_TEST_FILE_LIST=<selection> bash backend/test.sh   # 34 files, exit 0

View guided diff Turn on auto-fix

…ound

A conversation deleted (user delete, merge, empty-recording cleanup) while
its receipts still sit in the durable projection queue makes every pinned-
generation read 404 deterministically: retries rescue nothing, the batch
terminates into failed_recordings, and at the 128-entry session cap those
deleted conversations can poison later healthy recordings of the same
websocket session.

Catch NotFound before the generic projection handler: when the conversation
is tombstoned (same read as the custody write gate) or its doc no longer
exists, drop the refs without a custody failure, a failed_recordings entry,
or retry churn, and log the skip at info. A live conversation keeps today's
transient retry/terminal paths unchanged, and a failed deletion-intent read
fails open to the transient path rather than propagating out of the drain
loop.

The projection failure class warning now also names the innermost raising
frame (co_name only, never the message or args) so the unattributed
InvalidArgument minority becomes diagnosable without a redeploy.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T06:31:01.947193Z 73f3f8b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73f3f8bd88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/routers/pusher.py
Comment on lines +502 to +505
projection_retries.pop(conv_id, None)
logger.info('Durable audio projection skipped; conversation gone')
return
# Terminal for this batch: a later independent batch for the
# same conversation starts with a fresh budget instead of
# inheriting this one's exhaustion, and the entry stops
# counting toward the bounded retry map.
projection_retries.pop(conv_id, None)
await record_barrier.fail_recording(conv_id)
record_failure('projection', reason='transient')
record_fallback(
component='pusher',
from_mode='private_cloud_sync',
to_mode='raw_audio',
reason='other',
outcome='degraded',
log=logger,
)
logger.warning('Durable audio projection deferred after retries; archive receipt retained')
await _transient_projection_failure(exc, conv_id, refs)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the gone-owner projection behavior in the pipeline guide

This introduces a new durable-audio outcome: a NotFound for a tombstoned or missing conversation drops projection references without retries or a recording-failure marker. However, the commit updates only the router and tests, leaving backend/docs/listen_pusher_pipeline.mdx unchanged. backend/AGENTS.md explicitly requires that guide to be updated in the same PR for audio, conversation-lifecycle, or pusher WebSocket changes. Document the gone-owner exception and the retained transient behavior for live conversations so the pipeline contract reflects this change.

AGENTS.md reference: backend/AGENTS.md:L163-L163

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit c144a98 into main Oct 30, 2026
62 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/projfix branch October 30, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant