test(photon): pin startup obligation-redelivery contract through the real PhotonAdapter send path - #11
Merged
Conversation
…real PhotonAdapter send path PhotonAdapter dedupes inbound sidecar deliveries only; it has no outbound dedup, so the delivery ledger's crash-ambiguity contract is the only guard against a duplicate iMessage from a crash-recovered final response. No photon test exercised _redeliver_pending_obligations until now. Covers, with the sidecar transport stubbed at _sidecar_call so the real send/format_message/_sidecar_send chain runs: - ambiguous (attempting) rows carry RECOVERED_MARKER into the /send body; pending rows redeliver plainly and clear resume_pending - a delivered row is never claimed or sent again by a later boot's sweep - a sidecar failure leaves the row failed-but-claimed, spending exactly one attempt per boot until MAX_ATTEMPTS abandons it Test-only change under tests/plugins/platforms/photon/ (allowed overlay path); no upstream core files touched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Why
Upstream PR NousResearch#67181 (in the v2026.7.20 re-baseline) added the delivery-obligation ledger:
_redeliver_pending_obligations()runs at gateway startup and redelivers crash-recovered final responses viaadapter.send(...).PhotonAdapter dedupes inbound sidecar deliveries only (
_handled_deliveries/_accepted_handle_deliveries); it has no outbound dedup, so the ledger's crash-ambiguity rails (visibleRECOVERED_MARKER, delivered-state exclusion,MAX_ATTEMPTScap) are the only guard against a duplicate iMessage. No photon test exercised this path.What
One new test file,
tests/plugins/platforms/photon/test_obligation_redelivery.py, driving the realGatewayRunner._redeliver_pending_obligations()against a realPhotonAdapterwith only the sidecar HTTP transport stubbed (at_sidecar_call, so the realsend->format_message->_sidecar_sendchain runs; no Node sidecar, no ports). Proves:attempting) row redelivers withRECOVERED_MARKERsurviving into the sidecar/sendbody; apendingrow redelivers plainly and clearsresume_pendingdeliveredand a later boot's sweep never sends it again (exactly one/sendtotal)failed-but-claimed, spending one attempt per boot untilMAX_ATTEMPTSabandons it without a further sendThe runner harness mirrors the existing
tests/gateway/test_delivery_ledger.py::TestGatewayRedeliverySweepseam (the established convention for this method); fixture style mirrorstest_inbound.py.Scope
Test-only, under
tests/plugins/platforms/photon/(allowed overlay path perconfig/hermes_upstream_pin.yaml). Noagent/,gateway/, orhermes_cli/files touched.Evidence
🤖 Generated with Claude Code