Skip to content

Preserve provider-owned stale session-memory outcomes - #468

Merged
8Dionysus merged 2 commits into
mainfrom
codex/skills-audit-provider-stale-20260907
Sep 8, 2026
Merged

8Dionysus merged 2 commits into
mainfrom
codex/skills-audit-provider-stale-20260907

Conversation

@8Dionysus

Copy link
Copy Markdown
Owner

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 appended archive command failed and hid the distinction between stale data and a failed command.

Change

  • Preserve the closed set of stale reason codes emitted by the .aoa search freshness producer when they occur under a provider-shaped stale payload with a nonempty string provider marker.
  • Keep malformed provider markers, unknown diagnostics, nonempty evidence, transport failures, timeouts, and process failures fail-closed as backend errors.
  • Extend structured-state regressions to cover empty usage-chain state, the raw nested search-provider-status shape, unknown nested diagnostics, and malformed provider markers.

Validation

  • Full test_session_memory_mcp.py: 153 passed.
  • Targeted archive-outcome tests: 15 passed.
  • Ruff on touched source/tests: passed.
  • validate_session_memory_mcp.py: passed (mcp_only, read-only).
  • Retained live fixtures: stale provider classification and empty usage-chain classification matched the intended owner state after removing only the old wrapper-injected diagnostic.
  • Pinned aoa-kag 14ee1e33 owner-family gate: verified; sentinel, full parity, family contract, and compatibility assembly all returned 0.
  • Generated family receipt: kag/receipts/index_family_budget/c82d33b6a88ec24bd333bfc1de8b04b57cf37aaad15dd06ad1985405b25bb85d.json.

The KAG family was regenerated from candidate 09b9beb856e269248684580a7f257f13f4f1c1c9 against exact history, event-history, and budget base f6273717b923b625fd4d985db038ec42b8b19cb0. The generated companion is 14cfd7da1983ecdfff8482dd2774b7c45bb2a251; 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.

@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: 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@8Dionysus
8Dionysus merged commit b6e9af1 into main Sep 8, 2026
2 checks passed
@8Dionysus
8Dionysus deleted the codex/skills-audit-provider-stale-20260907 branch September 8, 2026 05:40
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