Skip to content

docs(adapters/codex-recovery-proxy): say what the proxy does for source_host and quarantine - #46

Merged
DottytheHomeless merged 1 commit into
mainfrom
fix/codex-proxy-review-p1
Oct 1, 2026
Merged

DottytheHomeless merged 1 commit into
mainfrom
fix/codex-proxy-review-p1

Conversation

@MXAntian

@MXAntian MXAntian commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

The adapter README said the bearer is forwarded unchanged, but not what that
means for provenance and quarantine, so a reader could not tell whether they
still apply to writes that arrive through the proxy.

They do, and the proxy has no part in it. The server resolves the host from
the Authorization header when a session is created (auth.mjs resolveHost,
MNEME_HOST_TOKENS), stamps source_host on writes from that session, and
routes hosts listed in MNEME_QUARANTINE_HOSTS into memories_quarantine.
The proxy opens a fresh session per call with the same bearer, so the host is
re-derived from the token on every call and behaviour matches a direct
connection.

This adds a short "Provenance 与 quarantine" section stating only that, plus
the points an operator can trip over:

  • MNEME_TOKEN_CODEX must be the token MNEME_HOST_TOKENS maps to the codex
    host. An unknown token is still served under soft/off but recorded as the
    default host, and rejected with 401 under enforce.
  • tools/list also opens a fresh session, so resolve_quarantine is only
    registered when that session's host is the primary host.

Documentation only; no code change. Every statement was checked against
auth.mjs and mcp-server.mjs. The adapter's fault-injection test passes
unchanged (node adapters/codex-recovery-proxy/proxy.test.mjs: 3/3 PASS).

🤖 Generated with Claude Code

…ce_host and quarantine

The README only said the bearer is forwarded unchanged. It did not say what
that buys, so a reader could not tell whether provenance and quarantine
still apply to writes that arrive through the proxy.

They do, and the proxy has no part in it. mcp-server.mjs resolves the host
from the Authorization header when a session is created (auth.mjs
resolveHost, MNEME_HOST_TOKENS), stamps source_host on writes from that
session, and routes hosts listed in MNEME_QUARANTINE_HOSTS into
memories_quarantine. The proxy opens a fresh session per call with the same
bearer every time, so the host is re-derived from the token on each call and
the server behaves exactly as it would for a direct connection.

Add a short "Provenance 与 quarantine" section that states only that, plus
the parts an operator can trip over:

- MNEME_TOKEN_CODEX has to be the token MNEME_HOST_TOKENS maps to the codex
  host. An unknown token is served under soft/off but recorded as the default
  host, and rejected with 401 under enforce.
- A fresh session is also opened for tools/list, so resolve_quarantine only
  appears when that session's host is the primary host.

No code change. The fault-injection test passes unchanged against this tree
(fresh sessions=60, calls=59, live sessions=0; both hanging-remote scenarios
surface an error inside the timeout window).

Co-Authored-By: 千夏 <qianxia@clawgamers.com>
@MXAntian
MXAntian marked this pull request as ready for review October 1, 2026 07:36
@DottytheHomeless
DottytheHomeless merged commit f29cf5c into main Oct 1, 2026
2 checks passed
@DottytheHomeless
DottytheHomeless deleted the fix/codex-proxy-review-p1 branch October 1, 2026 08:27
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.

2 participants