Preserve provider-owned stale session-memory outcomes - #468
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14cfd7da19
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| and provider_name.strip() | ||
| and provider_status in {"dirty", "stale", "stale-readable", "not_current"} | ||
| ): | ||
| allowed.update(MCP_OWNER_PROVIDER_STALE_REASON_CODES) |
There was a problem hiding this comment.
Reject hard quality diagnostics before preserving stale output
When a structured stale response contains recognized provider diagnostics but also reports a failure through quality.diagnostics, this whitelist causes _archive_payload_has_hard_diagnostic() to return false because its recursion never visits the quality container. _archive_command() then treats exit status 1 as an owner-reported stale outcome and omits archive command failed, hiding diagnostics such as a database read failure; validate every diagnostic-bearing container before applying the stale exception.
AGENTS.md reference: mcp/services/aoa-session-memory-mcp/AGENTS.md:L26-L33
Useful? React with 👍 / 👎.
Problem
The session-memory MCP adapter treated a valid owner-reported stale provider payload as a backend command failure. The payload carried
ok=false, exit status 1, structured freshness state, and provider-owned stale reason codes, so the access plane appendedarchive command failedand hid the distinction between stale data and a failed command.Change
.aoasearch freshness producer when they occur under a provider-shaped stale payload with a nonempty string provider marker.search-provider-statusshape, unknown nested diagnostics, and malformed provider markers.Validation
test_session_memory_mcp.py: 153 passed.validate_session_memory_mcp.py: passed (mcp_only, read-only).aoa-kag14ee1e33 owner-family gate: verified; sentinel, full parity, family contract, and compatibility assembly all returned 0.kag/receipts/index_family_budget/c82d33b6a88ec24bd333bfc1de8b04b57cf37aaad15dd06ad1985405b25bb85d.json.The KAG family was regenerated from candidate
09b9beb856e269248684580a7f257f13f4f1c1c9against exact history, event-history, and budget basef6273717b923b625fd4d985db038ec42b8b19cb0. The generated companion is14cfd7da1983ecdfff8482dd2774b7c45bb2a251; both source and generated commits received manual checkpoint review.Boundaries
This changes source classification and generated owner navigation projections. It does not claim runtime restart, deployment, provider freshness repair, reindexing, merge acceptance, or live consumer reload.