Skip to content

fix: agent-readiness — Bearer auth on renter balance/me + doc-accuracy#631

Open
dhnpmp-tech wants to merge 1 commit into
mainfrom
fix/agent-readiness-balance-bearer
Open

fix: agent-readiness — Bearer auth on renter balance/me + doc-accuracy#631
dhnpmp-tech wants to merge 1 commit into
mainfrom
fix/agent-readiness-balance-bearer

Conversation

@dhnpmp-tech

Copy link
Copy Markdown
Owner

What

Agent-readiness pass for the agent-first MCP story. Fixes the auth inconsistency and doc inaccuracies that would trip a fully-autonomous agent, without touching feat/burst-bridge.

Backend (quick, safe)

  • GET /api/renters/balance and GET /api/renters/me now accept Authorization: Bearer <key> (via the existing getBearerToken helper), matching /v1/* and /api/pods. Previously a Bearer-only agent got {"error":"API key required"} on balance/me while inference + pods worked — and llms.txt already advertises balance over Bearer, so the docs were ahead of the code.
  • Improved the 400 message to list all three accepted forms (Bearer / x-renter-key / ?key=).

Docs accuracy

  • public/llms.txt: the MCP tool list named a non-existent list_pods and omitted get_pod / get_volume. Now matches the 9 tools the server actually exposes (list_models, chat, get_balance, create_pod, get_pod, extend_pod, stop_pod, rent_volume, get_volume).
  • docs/openapi.yaml + public/docs/openapi.yaml: renter key prefix is dc1-sk- (not dc1-renter-); documented Bearer as an accepted auth form.

Why

The MCP server only works on balance today because integrations/dcp-mcp/index.js sends BOTH Authorization: Bearer AND x-renter-key (belt+braces). A pure-Bearer agent (any OpenAI-SDK-style client) would fail balance/me. This closes that gap.

Test plan

  • node --check backend/src/routes/renters.js
  • both OpenAPI YAMLs parse (yaml.safe_load)
  • live prod confirmed the bug before fix: curl -H "Authorization: Bearer dc1-sk-..." https://api.dcp.sa/api/renters/balance -> {"error":"API key required"}
  • after deploy: same curl returns the balance JSON

Not in scope (flagged for owner)

  • @dcp/mcp is not published to npm (404) and no npm creds on this machine — owner must npm publish --access public. Homepage/docs tell agents to npx -y @dcp/mcp, which fails until then.
  • MCP create_pod has no gpu_type/provider_id selector (bug feat(volt): Billing Engine — SAR Metering, Wallet, Moyasar Integration #3) — agents can only get an auto-picked native GPU, not the advertised burst types. Needs an MCP + backend change.
  • Agent self-serve onboarding still requires a human email magic-link click to mint the first key + get the 100 SAR trial.

🤖 Generated with Claude Code

…cy fixes

Makes the DCP renter API consistent for agents that authenticate with
Authorization: Bearer (the form MCP/OpenAI-SDK agents use).

- backend: GET /api/renters/balance and GET /api/renters/me now also accept
  Authorization: Bearer <key> (via getBearerToken), matching /v1/* and
  /api/pods. Previously a Bearer-only request got "API key required" while
  inference + pods worked, even though llms.txt advertises balance over Bearer.
  Improved the 400 message to list all three accepted auth forms.
- docs(llms.txt): correct the MCP tool list — it listed a non-existent
  `list_pods` and omitted `get_pod`/`get_volume`. Now matches the 9 tools
  the server actually exposes.
- docs(openapi.yaml + public copy): renter key prefix is `dc1-sk-`, not
  `dc1-renter-`; document Bearer as an accepted auth form.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dc1-platform Ready Ready Preview, Comment Jun 19, 2026 4:45am

Request Review

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