Skip to content

fix: sandbox worker sessions - #14

Merged
aiedwardyi merged 4 commits into
mainfrom
fix/sandboxed-workers
Jul 21, 2026
Merged

fix: sandbox worker sessions#14
aiedwardyi merged 4 commits into
mainfrom
fix/sandboxed-workers

Conversation

@aiedwardyi

@aiedwardyi aiedwardyi commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Sandboxes worker and critic sessions without changing local workflows. Adds regression coverage and a reproducible FAIL then PASS evaluation.

Review fixes applied:

  • 7fe4f2e - clarifies evaluation evidence and strengthens compatibility checks.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agentloop-replay Ready Ready Preview, Comment Jul 21, 2026 8:25pm

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 412637c8-f27d-4013-9e8d-e035e151678a

📥 Commits

Reviewing files that changed from the base of the PR and between 9331de6 and 7fe4f2e.

📒 Files selected for processing (3)
  • docs/evaluation.md
  • package.json
  • test/sandbox.test.js
📜 Recent review details
🔇 Additional comments (3)
test/sandbox.test.js (1)

7-36: LGTM!

package.json (1)

7-7: LGTM!

docs/evaluation.md (1)

3-5: LGTM!

Also applies to: 9-12, 16-19


📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added a query parser example with URL decoding, repeated-key handling, malformed-input tolerance, and CLI guidance.
    • Added reproducible evaluation documentation and quality guidelines for the query parser.
  • Security & Reliability
    • Workers now run with workspace-only sandboxing, disabled network access, and approval requests for boundary operations.
  • Tests
    • Added automated coverage validating the worker sandbox and approval configuration.
  • Documentation
    • Clarified AgentLoop’s target use case and updated sandbox behavior documentation.
    • Removed an outdated roadmap promise.

Walkthrough

AgentLoop now documents its target audience and worker sandbox configuration, adds tests for explicit Codex approval settings, and introduces a query parser example with planning, requirements, implementation, and independent evaluation documentation.

Changes

Worker sandbox controls

Layer / File(s) Summary
Explicit worker sandbox configuration
src/daemon.js, test/sandbox.test.js, package.json, README.md
Both worker-spawning paths use workspace-write sandboxing, on-request approvals, automatic review, and disabled sandbox network access. Tests verify the arguments and the test script runs them. README documents the sandbox behavior.

Query parser evaluation

Layer / File(s) Summary
Query parser contract and implementation
examples/query-parser/*
Adds requirements, repair planning, state tracking, and a CommonJS parseQuery(input) implementation.
Evaluation record and project positioning
docs/evaluation.md, README.md
Documents the independent multi-cycle evaluation and reproduction steps, adds the target-audience description, and removes the OS-level sandboxing roadmap item.

Estimated code review effort: 2 (Simple) | ~10 minutes


Comment @coderabbitai help to get the list of available commands.

@aiedwardyi
aiedwardyi marked this pull request as ready for review July 21, 2026 20:09
@aiedwardyi

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai coderabbitai 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.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/evaluation.md`:
- Line 3: Update the evaluation date in the document’s opening statement to the
actual execution date, July 21, 2026, or rerun the evaluation and record that
resulting date; keep the surrounding run details unchanged.

In `@examples/query-parser/query-string.js`:
- Around line 1-6: The query parser in parseQuery must handle empty queries,
convert plus signs to spaces, preserve repeated keys as arrays, assign empty
values to bare keys, tolerate malformed percent-encoding, and retain additional
equals signs in values; update its parsing and decoding logic accordingly. In
docs/evaluation.md lines 7-10, rerun the independent evaluation against the
corrected parser and record the resulting status and actual test count.
- Line 9: Extend the module containing parseQuery with a command-line entry
point in addition to its existing export. When invoked directly, read the query
argument, output the parsed result as JSON, and display usage plus exit non-zero
when the required argument is missing; preserve parseQuery’s reusable module
behavior when imported.

In `@examples/query-parser/STATE.md`:
- Around line 3-13: Update the state entries in STATE.md to reflect that the
query parser repair is complete and verification has succeeded: replace the
unfinished “Completed” status, remove the pending repair from “Next,” and update
“Notes” to record the available evaluation or critic feedback instead of
claiming none exists.

In `@package.json`:
- Around line 6-8: Update the package.json test script to use a test invocation
supported by Node.js 18.0.x, preserving the existing test coverage and the
declared Node.js 18 minimum; alternatively, consistently raise the minimum
Node.js requirement to 18.1.0 in the package metadata and documentation.

In `@test/sandbox.test.js`:
- Around line 8-13: Update the sandbox contract test around spawnLoopSession and
spawnWorker to inspect each function’s args block independently rather than
relying on global occurrence counts. Assert that both spawn paths separately
include workspace-write sandboxing, on-request approval policy, auto_review
approvals, and disabled network access, while retaining the bypass-flag
assertion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 93e5ee69-ebef-4461-9877-4d2775cc9593

📥 Commits

Reviewing files that changed from the base of the PR and between baf5d02 and 9331de6.

📒 Files selected for processing (9)
  • README.md
  • docs/evaluation.md
  • examples/query-parser/GUIDELINES.md
  • examples/query-parser/PLAN.md
  • examples/query-parser/STATE.md
  • examples/query-parser/query-string.js
  • package.json
  • src/daemon.js
  • test/sandbox.test.js
📜 Review details
🧰 Additional context used
🪛 ast-grep (0.44.1)
test/sandbox.test.js

[warning] 5-5: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(path.join(__dirname, '..', 'src', 'daemon.js'), 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename)

🔇 Additional comments (4)
examples/query-parser/GUIDELINES.md (1)

3-12: LGTM!

examples/query-parser/PLAN.md (1)

3-8: LGTM!

src/daemon.js (1)

769-772: LGTM!

Also applies to: 1264-1267

README.md (1)

13-14: LGTM!

Also applies to: 37-37, 47-52, 142-143

Comment thread docs/evaluation.md Outdated
Comment thread examples/query-parser/query-string.js
Comment thread examples/query-parser/query-string.js
Comment thread examples/query-parser/STATE.md
Comment thread package.json
Comment thread test/sandbox.test.js Outdated

@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: 9331de64e9

ℹ️ 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 docs/evaluation.md Outdated
@aiedwardyi
aiedwardyi merged commit bc920cb into main Jul 21, 2026
3 checks passed
@aiedwardyi
aiedwardyi deleted the fix/sandboxed-workers branch July 21, 2026 20:36
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