Skip to content

fix(monitors): reauthorize before process spawn - #535

Merged
andrei-hasna merged 4 commits into
mainfrom
fix/f4a9b60f-spawn-boundary-authorization
Aug 10, 2026
Merged

fix(monitors): reauthorize before process spawn#535
andrei-hasna merged 4 commits into
mainfrom
fix/f4a9b60f-spawn-boundary-authorization

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • recheck the current thread writer fence, permission profile, and cwd after persisting the monitor start event
  • use only the refreshed execution snapshot and config for sandboxed process spawn
  • preserve the existing generation, routing, sandbox, and cleanup behavior

Regression

  • thread_monitor_runtime_does_not_spawn_after_permission_changes_during_start_event_persistence pauses after event persistence, mutates the live permission profile, resumes, and requires failure without a process id
  • authoritative AWS RED at 4aef7a22b95bf3a3925137b53175d74fadc96353: named stale-authorization assertion failed
  • AWS GREEN and hosted exact-head checks pending

Local gates

  • just fmt
  • git diff --check and cached diff check
  • staged Shield: no security issues
  • staged and exact-range Gitleaks: zero findings

Todos: f4a9b60f-b202-4a0d-b7bc-bb6ac2f43099
Focused re-review remains assigned only to Lovelace session 019fe802-b5ae-7033-ba6d-e6f7185dd943 after remote gates.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Agent: iapp-factory-coordinator
Recheck the current thread writer, permission profile, and cwd after the start event is persisted, and use only the refreshed execution context for the sandboxed child.

Agent: iapp-factory-coordinator
Agent: iapp-factory-coordinator
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] GO — #535 @ 05c98cb — lens: correctness+security+gates, reviewer Damon (1 of 1)

Reviewed exact candidate

  • Base: origin/main at c3c84a8.
  • git log --oneline origin/main..HEAD: exit 0; 4 commits.
  • git diff origin/main...HEAD --stat: exit 0; 2 files, 199 insertions, 6 deletions.
  • Full diffs and surrounding source read for codex-rs/app-server/src/request_processors/thread_monitor_runtime.rs and codex-rs/app-server/src/message_processor_schedule_tests.rs, plus the monitor authorization model, command authorization path, and thread-settings update path.

What I ran

  • bun install: exit 0; setup only, 521 packages installed. This is not a test gate.
  • gh pr view 535 --repo hasna/codewith --json statusCheckRollup: exit 0; final counts: 25 SUCCESS, 0 FAILURE, 3 SKIPPED, 0 pending.
  • Initial sdks attempt: 37 passed, 1 timed out, 38 total. gh run rerun 31370486973 --repo hasna/codewith --failed: exit 0; the rerun completed SUCCESS.
  • No lane-chosen test command was run. The repository declares no test script and therefore no repository test gate. It also declares no typecheck script.

Forge checks read

  • Bazel test on ubuntu-24.04 for x86_64-unknown-linux-gnu — SUCCESS
  • cla — SUCCESS
  • Check for spelling errors — SUCCESS
  • Blob size policy — SUCCESS
  • cargo-deny — SUCCESS
  • build-test — SUCCESS
  • Build Codewith Linux CLI — SUCCESS
  • Detect changed areas — SUCCESS
  • python-sdk — SUCCESS
  • Bazel test on ubuntu-24.04 for x86_64-unknown-linux-musl — SUCCESS
  • Bazel test on windows-latest for x86_64-pc-windows-gnullvm shard 1/4 — SUCCESS
  • Format / etc — SUCCESS
  • sdks — SUCCESS
  • Bazel test on windows-latest for x86_64-pc-windows-gnullvm shard 2/4 — SUCCESS
  • Bazel test on windows-latest for x86_64-pc-windows-gnullvm shard 3/4 — SUCCESS
  • Bazel test on windows-latest for x86_64-pc-windows-gnullvm shard 4/4 — SUCCESS
  • Bazel test on windows-latest for x86_64-pc-windows-gnullvm (native main) — SKIPPED
  • cargo shear — SUCCESS
  • Argument comment lint package — SKIPPED
  • Bazel clippy on ubuntu-24.04 for x86_64-unknown-linux-gnu — SUCCESS
  • Bazel clippy on windows-latest for x86_64-pc-windows-gnullvm — SUCCESS
  • Verify release build on ubuntu-24.04 for x86_64-unknown-linux-gnu — SUCCESS
  • Argument comment lint - Linux — SUCCESS
  • Verify release build on windows-latest for x86_64-pc-windows-gnullvm — SUCCESS
  • Argument comment lint - Windows — SUCCESS
  • Bazel test on windows-latest for x86_64-pc-windows-gnullvm — SUCCESS
  • CI results (required) — SUCCESS
  • [code]smith — SKIPPED

Blocking P0/P1 findings

  • None. The final pre-spawn authorization read binds the launch to the current writer fence, permission profile, thread CWD, and runtime config after asynchronous start-event persistence. The race regression test forces the stale-authorization window and verifies no process is created and the monitor is marked failed.

Non-blocking follow-up

  • The first SDK attempt hit the existing 5-second timeout in sdk/typescript/tests/run.test.ts; it has no code-path overlap with this Rust monitor change and passed on rerun. This is flaky-test hardening, not a blocker for this candidate.

@andrei-hasna
andrei-hasna merged commit a37d762 into main Aug 10, 2026
29 of 30 checks passed
@andrei-hasna
andrei-hasna deleted the fix/f4a9b60f-spawn-boundary-authorization branch August 10, 2026 09:02
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant