Skip to content

✨ feat: add boxsh sandbox foundation#95

Merged
vaayne merged 14 commits intomainfrom
stack/boxsh-foundation
Apr 13, 2026
Merged

✨ feat: add boxsh sandbox foundation#95
vaayne merged 14 commits intomainfrom
stack/boxsh-foundation

Conversation

@vaayne
Copy link
Copy Markdown
Owner

@vaayne vaayne commented Apr 13, 2026

Stack

Summary

  • add the boxsh sandbox backend foundation and session model
  • add boxsh RPC client, shared backend, policy contracts, and core tool mediation primitives
  • add sandbox preflight validation, managed boxsh download wiring, and backend test coverage

Testing

  • mise run test

Copy link
Copy Markdown

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

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: 9e4711f247

ℹ️ 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 on lines +557 to +559
// Use a client that doesn't enforce timeout on body reads
client := &http.Client{Timeout: timeout}
resp, err := client.Do(req) //nolint:bodyclose // body ownership is transferred to localHTTPStream
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove client timeout from streaming HTTP connections

OpenHTTPStream builds an http.Client with Timeout set, but in Go that timeout applies to the full request lifecycle including response body reads. For long-lived SSE/streamable HTTP sessions, this forces healthy streams to terminate once the timeout (default 30s here) is reached, which breaks streaming transports on the local backend.

Useful? React with 👍 / 👎.

Comment on lines +623 to +625
go func() {
done <- p.cmd.Wait()
}()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Drain process pipes before waiting for exit

Wait blocks on cmd.Wait() before consuming stdout/stderr, so a child that writes enough output to fill either pipe can block on write and never exit. In that case Wait hangs until context cancellation, so callers that rely on Wait to collect output (without concurrently reading pipes themselves) can deadlock on verbose commands.

Useful? React with 👍 / 👎.

Comment thread internal/sandbox/factory.go Outdated
Comment on lines +179 to +181
// Try boxsh first if available, then fall through to local
for _, name := range []string{"boxsh", "local"} {
factory, exists := r.factories[name]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Iterate registered backends during auto selection

The auto-selection path only checks boxsh and local explicitly, so any additional backend registered through Register is ignored when policy.Backend is empty. This can cause CreateSession to fail with “no registered backend can satisfy this policy” even when a compatible registered backend exists.

Useful? React with 👍 / 👎.

@vaayne vaayne merged commit 5f305a3 into main Apr 13, 2026
4 of 6 checks passed
@vaayne vaayne deleted the stack/boxsh-foundation branch April 13, 2026 14:46
@vaayne vaayne restored the stack/boxsh-foundation branch April 13, 2026 14:46
@vaayne vaayne deleted the stack/boxsh-foundation branch April 14, 2026 14:21
vaayne added a commit that referenced this pull request Apr 17, 2026
✨ feat: add boxsh sandbox foundation
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