Skip to content

fix(api): accept documented session-create defaults - #126

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-afa9
Draft

fix(api): accept documented session-create defaults#126
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-afa9

Conversation

@cursor

@cursor cursor Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

Documented session-create calls omit namespace (docs.html, OpenAPI, playground sample), but the handler required it after the credit deduction step. A user following the published curl or playground sample could lose 5 credits and receive 400 namespace is required instead of a session.

Root cause

/v1/tools/session-create deducted credits before validating request shape, then rejected missing namespace even though the public contract advertised it as unnecessary.

Fix

  • Default omitted namespace to default.
  • Validate namespace/model before deducting credits.
  • Keep existing owner binding and x402 model pin behavior unchanged.

Validation

  • npm run build && node tests/session-pricing.test.mjs
  • DATABASE_URL=postgresql://arch:arch@localhost:5432/arch_dev TEST_BASE_URL=http://localhost:8787 node tests/session-ownership.test.js
Open in Web View Automation 

Co-authored-by: Deesmo <Deesmo@users.noreply.github.com>
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