Skip to content

fix(codemode): harden OpenAPI sandbox ref handling#1508

Merged
threepointone merged 2 commits into
mainfrom
fix/codemode-openapi-sandbox-followups
May 12, 2026
Merged

fix(codemode): harden OpenAPI sandbox ref handling#1508
threepointone merged 2 commits into
mainfrom
fix/codemode-openapi-sandbox-followups

Conversation

@threepointone
Copy link
Copy Markdown
Contributor

@threepointone threepointone commented May 12, 2026

Summary

  • Preserve sandbox-side truncation metadata for OpenAPI search/execute results without dropping host-side truncation for custom executors.
  • Cache internal OpenAPI $ref resolution work inside the sandbox while returning cloned resolved schemas so repeated refs do not share mutable objects.
  • Clean up OpenAPI tool descriptions after lazy sandbox resolution and add regression coverage for truncation and $ref edge cases.

Test plan

  • npx vitest run src/tests/mcp.test.ts
  • npx nx run @cloudflare/codemode:test
  • git diff --check
  • Edited-file lints clean in Cursor

Notes

This follows up on #1470. That PR moved OpenAPI spec resolution into the sandbox to avoid Worker Loader RPC size limits for heavily referenced specs. This PR tightens the behavior around the new sandbox boundary and documents the expected edge-case behavior in tests.

Made with Cursor


Open in Devin Review

Avoid double-truncating sandbox OpenAPI results while keeping host-side truncation for custom executors. Cache internal OpenAPI ref resolution work inside the sandbox without exposing shared mutable schema objects, and cover ref edge cases introduced by resolving specs inside generated code.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

🦋 Changeset detected

Latest commit: 616839a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/codemode Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@threepointone threepointone requested a review from mattzcarey May 12, 2026 10:51
Copy link
Copy Markdown
Contributor

@mattzcarey mattzcarey left a comment

Choose a reason for hiding this comment

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

this looks great. needs a changeset.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@threepointone threepointone merged commit 13acffe into main May 12, 2026
3 checks passed
@threepointone threepointone deleted the fix/codemode-openapi-sandbox-followups branch May 12, 2026 10:59
@github-actions github-actions Bot mentioned this pull request May 12, 2026
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