Skip to content

feat(sandboxes): add Ruby session and execution facade - #316

Merged
shawnwu-kong merged 14 commits into
mainfrom
codex/sandbox-hosting-p7
Oct 5, 2026
Merged

shawnwu-kong merged 14 commits into
mainfrom
codex/sandbox-hosting-p7

Conversation

@shawnwu-kong

@shawnwu-kong shawnwu-kong commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add the Ruby Sandbox facade for one-shot commands, sessions, lifecycle operations, binary files, scoped HTTP access, and backend-managed user grants. Preserve request IDs and command results, refresh granted-user sessions once on HTTP 401, and preserve block exceptions during cleanup.

Use explicit keyword arguments, validate timestamp inputs, expose expiry timestamps as UTC Time values, redact credential-bearing inspect output, and retain service credentials on handles created by a backend. Cleanup accepts terminating/terminated sessions and HTTP 404. Public presets need no credentials; the generated contract accepts catalog-defined preset IDs and uses canonical region names.

HTTP timeouts preserve configured short-call settings and extend command-completion calls only. Auth retries snapshot nested payloads and preserve immutable session identity. Lifecycle state also owns a frozen snapshot, so caller or response mutations cannot bypass block cleanup. Documentation distinguishes one-shot HTTP 504/409 errors from session-command timeout results.

Validation

  • Latest head (cb99f31): documentation-only correction uses /workspace/input.bin consistently for the public binary-file example; diff checks passed and remote checks are running.
  • Implementation head (a20be52): all eight remote checks passed, including Quality Gate and full Ruby 3.2/3.4 quality checks. Two caller/response mutation regressions failed before the fix; all 52 local Sandbox regressions, native changed-file lint, and strict Sandbox Steep passed afterward.
  • Each Ruby version: 1,902 examples, 100% line coverage (Ruby 3.2: 4,979/4,979; Ruby 3.4: 5,016/5,016) and branch coverage (1,419/1,419), both strict Steep targets, annotation necessity, exact lint-exception checks, injected-defect checks, dependency audit, and isolated gem installation/quickstart.
  • RuboCop: 383 files, no offenses. Deterministic OpenAPI generation passed.
  • Local Sandbox regressions and strict target checks passed. Two explicit-keyword declarations use documented repository-delegated parameter-count exceptions; native inverse lint verifies their exact scopes without changing thresholds or type contracts.
  • Live Sandbox acceptance remains pending coordinated rollout.

Coordination

Hosting Kong/volcano-hosting#1354; JavaScript Kong/volcano-sdk-js#270; Python Kong/volcano-sdk-python#372. Hosting 0c31966b7 provides the expired-session HTTP 401 fix with passing native HTTP regressions, and owns canonical shared acceptance scenarios. Hosting staging acceptance uses SDK main, so merge the SDK implementations before final cross-language acceptance. No gem publication.

@shawnwu-kong

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T16:16:27.650414Z 5a78b94 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7b8b79eea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/volcano/sandbox_request.rb Outdated
Comment thread lib/volcano/sandbox_request.rb Outdated
Comment thread lib/volcano/sandbox_session.rb Outdated
@shawnwu-kong
shawnwu-kong marked this pull request as ready for review October 2, 2026 21:17
@shawnwu-kong
shawnwu-kong requested a review from a team as a code owner October 2, 2026 21:17

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a78b94c26

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/volcano/sandbox_request.rb Outdated
Comment thread lib/volcano/sandbox_request.rb
Comment thread lib/volcano/sandbox_session.rb
swkeever
swkeever previously approved these changes Oct 5, 2026

@swkeever swkeever left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving. Credential routing, the refresh wrapper, block-exception preservation, short-call timeouts, payload snapshots, and frozen IDs from the earlier Codex threads are all addressed.

Inline comments are non-blocking. The positional options Hash on create/exec is the one I'd most like changed before release: it's the only facade not using keywords, and switching later breaks callers.

Separately, a pre-existing issue that this PR doesn't introduce: GeneratedTransportSupport sets configuration.timeout to milliseconds (timeout_milliseconds), but Typhoeus/Ethon treat :timeout as seconds (CURLOPT_TIMEOUT). Configured timeouts are effectively ~1000x too long across the SDK. Worth its own issue.

Comment thread lib/volcano/sandboxes.rb Outdated
Comment thread lib/volcano/sandbox_session.rb Outdated
Comment thread lib/volcano/sandbox_session.rb
Comment thread lib/volcano/sandbox_request.rb
Comment thread lib/volcano/sandboxes.rb Outdated
Comment thread lib/volcano/sandbox_session.rb
Comment thread openapi/openapi.yaml Outdated
Comment thread lib/volcano/sandbox_response.rb

@tkkhq tkkhq left a comment •

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.

Blocking: the existing mutable-state finding remains at lib/volcano/sandbox_response.rb:35 and lib/volcano/sandbox_session.rb:49: session.state.replace("terminated") makes use skip termination without a server response. I reproduced this against the current head; store an owned frozen state and add a regression that verifies observation cannot change cleanup behavior.

@shawnwu-kong
shawnwu-kong merged commit a5b968a into main Oct 5, 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.

4 participants