Skip to content

feat: harden Responses gateway operations#4

Merged
clutchpbcfo merged 6 commits into
mainfrom
harden/responses-gateway
Jul 23, 2026
Merged

feat: harden Responses gateway operations#4
clutchpbcfo merged 6 commits into
mainfrom
harden/responses-gateway

Conversation

@clutchpbcfo

Copy link
Copy Markdown
Owner

Summary

  • remove fabricated zero token usage and mark provider usage as unavailable
  • add server request IDs, process-local idempotency replay/conflict handling, and secret-free structured logs
  • propagate disconnect cancellation through MCP fetch/polling while failing closed after provider dispatch
  • reserve local daily budget durably, commit at create_thread dispatch, and release only before dispatch
  • separate liveness/readiness, reject non-loopback binds, and document supported self-host/container operation
  • validate official OpenAI JavaScript and Python clients against mocked Hyperagent clients

Validation

  • CODEX_BIN="$(command -v codex)" OPENAI_PYTHON_BIN=".../python" npm test — 35/35 passing
  • git diff --check
  • node --check across source, tests, and JS fixtures
  • npm audit --audit-level=high — 0 vulnerabilities
  • npm pack --dry-run --json
  • targeted secret-pattern scan; only deliberate test placeholders/source field names matched

No Hyperagent credentials, real provider calls, live credits, deployment, or merge were used. Docker is not installed in the validation environment, so the image was not built locally.

Requires Hyperagent platform support

Exactly these remaining guarantees cannot be implemented from the documented OAuth MCP surface:

  1. Authoritative token and/or dollar usage returned with thread results.
  2. A documented remote thread cancellation operation for client disconnects and timeouts.
  3. Provider-backed idempotency plus lookup/reconciliation for ambiguous create_thread outcomes and safe replay across gateway restarts.

Until those exist, the bridge omits usage, cancels local polling only, conservatively commits dispatched budget slots, and fails closed on indeterminate idempotent retries.

@clutchpbcfo
clutchpbcfo marked this pull request as ready for review July 23, 2026 04:59
@clutchpbcfo
clutchpbcfo merged commit ad1580a into main Jul 23, 2026
8 checks passed
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