Skip to content

feat(agents): redeem device codes from the body; agent sign-in and management errors - #1180

Merged
kphurley7 merged 3 commits into
mainfrom
kph/muse-spec-b-agent-signin-manage
Oct 14, 2026
Merged

kphurley7 merged 3 commits into
mainfrom
kph/muse-spec-b-agent-signin-manage

Conversation

@kphurley7

Copy link
Copy Markdown
Contributor

Agent sign-in and management errors; redeem takes the code in the body.

  • Breaking: POST /agents/device-codes/{code}/redeem moves to POST /agents/device-codes/redeem with the code in the body; it documents its 403 and 429.
  • GET /agents, PATCH/DELETE /agents/{agentId}, PATCH /agents/{agentId}/policy and GET /agents/me document a 403 when the Agents API is not enabled; GET /agents documents a 404 for an unknown customer filter.
  • A policy spending-limits update must keep the agent's currency.
  • Stainless maps the moved redeem route.

Needs the breaking-change label and API-reviewer approval.

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

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

3 Skipped Deployments
Project Deployment Actions Updated
grid-cards-demo Ignored Ignored Preview Oct 14, 2026 6:13pm UTC
grid-flow-builder Ignored Ignored Preview Oct 14, 2026 6:13pm UTC
grid-wallet-demo Ignored Ignored Preview Oct 14, 2026 6:13pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Critical impact] Changes the public API contract for agent device code redemption.

The specific rate limits must be documented before merging to satisfy the repository requirement; the stale skill reference should also be updated.

Findings

  1. P2 Rate limits lack specific values ▶
  2. P2 Skill lists the removed route ▶
Fix with agent prompt
### Issue 1
mintlify/openapi.yaml:8453
The new redemption description names who is rate limited but gives no request counts or time windows. The documentation rule requires “Include rate limiting information with specific limits.” Add the actual limits to the source description and regenerate the bundles so callers know how often they can redeem codes. This repository requirement must be satisfied before merging.

### Issue 2
openapi/openapi.yaml:353-354
Moving redemption leaves `.claude/skills/grid-api/references/endpoints.md:271` pointing to `POST /agents/device-codes/{code}/redeem`. The Grid API skill tells assistants to read that reference when answering API questions, so they can still recommend the removed route. Update the reference to `POST /agents/device-codes/redeem` and explain that `code` belongs in the JSON body.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Moves device-code redemption to POST /agents/device-codes/redeem, with code in the JSON body.

  • Agents now send device codes in the body when redeeming them.
  • Agent route docs spell out disabled access and unknown-customer errors.
  • Policy updates now keep the spending-limits currency unchanged.

kphurley7 explicitly acknowledges the breaking route change in the PR description. That intentional change is not reported as a defect; the stale internal reference is reported separately.

Reviews (1) · Last reviewed commit: "feat(agents): redeem device codes from t..." · Reviewed by Greptile

Comment thread mintlify/openapi.yaml Outdated
Redeem a device code to obtain agent credentials. This endpoint is called by the agent software during installation. On success, returns a Bearer access token that the agent uses for all subsequent API calls. The token is returned only once and must be stored securely.
This endpoint does not require platform authentication — the device code itself serves as proof of authorization.
This endpoint does not require platform authentication — the device code itself serves as proof of authorization. A code can be redeemed only once and only before its `expiresAt`.
Redemption is rate limited per client IP address and across all callers, and calls made with platform credentials are limited per platform instead. A caller over a limit receives `429` and should back off before retrying.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Rate limits lack specific values

The new redemption description names who is rate limited but gives no request counts or time windows. The documentation rule requires “Include rate limiting information with specific limits.” Add the actual limits to the source description and regenerate the bundles so callers know how often they can redeem codes. This repository requirement must be satisfied before merging.

Context Used: mintlify/AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/openapi.yaml
Line: 8453

Comment:
**Rate limits lack specific values**

The new redemption description names who is rate limited but gives no request counts or time windows. The documentation rule requires “Include rate limiting information with specific limits.” Add the actual limits to the source description and regenerate the bundles so callers know how often they can redeem codes. This repository requirement must be satisfied before merging.

**Context Used:** mintlify/AGENTS.md ([source](https://github.com/lightsparkdev/grid-api/blob/main/mintlify/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in fe23a22. The redeem description now states the enforced limits: fixed 60-second windows, 10 per client IP and 1,000 in total for callers without platform credentials, or 600 per platform for calls with platform credentials. Over the limit returns 429 RATE_LIMITED, and the call is also rejected with 429 if the limit cannot be checked. Both bundles are regenerated.

Comment thread openapi/openapi.yaml
Comment on lines +353 to +354
/agents/device-codes/redeem:
$ref: paths/agents/agents_device-codes_redeem.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Skill lists the removed route

Moving redemption leaves .claude/skills/grid-api/references/endpoints.md:271 pointing to POST /agents/device-codes/{code}/redeem. The Grid API skill tells assistants to read that reference when answering API questions, so they can still recommend the removed route. Update the reference to POST /agents/device-codes/redeem and explain that code belongs in the JSON body.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/openapi.yaml
Line: 353-354

Comment:
**Skill lists the removed route**

Moving redemption leaves `.claude/skills/grid-api/references/endpoints.md:271` pointing to `POST /agents/device-codes/{code}/redeem`. The Grid API skill tells assistants to read that reference when answering API questions, so they can still recommend the removed route. Update the reference to `POST /agents/device-codes/redeem` and explain that `code` belongs in the JSON body.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already fixed in 9732499: the reference now lists POST /agents/device-codes/redeem with the code in the JSON body.

@kphurley7
kphurley7 force-pushed the kph/muse-spec-b-agent-signin-manage branch from a6310a8 to 9732499 Compare October 14, 2026 17:35
k15z
k15z previously approved these changes Oct 14, 2026
Base automatically changed from kph/muse-spec-a-agent-read-create to main October 14, 2026 17:50
@kphurley7
kphurley7 dismissed k15z’s stale review October 14, 2026 17:50

The base branch was changed.

@mintlify

mintlify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Grid 🟢 Ready View Preview Oct 14, 2026, 6:13 PM

kphurley7 and others added 3 commits October 14, 2026 11:05
…nagement errors

POST /agents/device-codes/{code}/redeem moves to POST /agents/device-codes/redeem
with the code in the body, so the secret never appears in a URL or access log
(breaking for that path); redeem documents its 403 and 429. GET /agents,
PATCH/DELETE /agents/{agentId}, PATCH /agents/{agentId}/policy and
GET /agents/me answer 403 when the Agents API is not enabled for the
platform, and GET /agents answers 404 for an unknown customer filter. Policy
spending-limit updates must keep the agent's original currency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TeBuC5ym3AR1ZJ6eocSFGT
@kphurley7
kphurley7 force-pushed the kph/muse-spec-b-agent-signin-manage branch from 9732499 to fe23a22 Compare October 14, 2026 18:13
@github-actions github-actions Bot added the breaking-change Introduces a breaking change to the OpenAPI spec label Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Breaking OpenAPI changes detected

oasdiff reports 1 error / 0 warning changes to openapi.yaml.
This PR will need approval from an API reviewer before merge.

Errors (1)

  • POST /agents/device-codes/{code}/redeem — api path removed without deprecation [api-path-removed-without-deprecation].

Detected by oasdiff. Full report: job summary or the oasdiff-report artifact.

@kphurley7
kphurley7 merged commit 1ac8d14 into main Oct 14, 2026
10 checks passed
@kphurley7
kphurley7 deleted the kph/muse-spec-b-agent-signin-manage branch October 14, 2026 22:56

This branch was successfully deployed

1 active deployment
staging - mintlify — fe23a221 Deployed Oct 14, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Introduces a breaking change to the OpenAPI spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants