Skip to content

Make native reproduction environments survive agent tool calls - #7912

Open
serena-ruan wants to merge 1 commit into
mainfrom
feat/omni-8844-managed-repro-env
Open

serena-ruan wants to merge 1 commit into
mainfrom
feat/omni-8844-managed-repro-env

Conversation

@serena-ruan

Copy link
Copy Markdown
Collaborator

Related issue

Replaces #7907. Tracking: OMNI-8844.

Summary

Native reproduction can fail when a server dies with an agent shell, a credential proxy placeholder selects a live provider, or onboarding is written outside the selected config directory. Add a foreground reproduction supervisor that owns the product server, runner, and existing mock model server in a persistent sandbox. Each independent shell reconnects through python -m dev.repro_env exec -- <command>; the existing native fixtures attach to the prepared runner.

In plain terms: start the test environment once and reconnect each agent call until recording finishes. The authored journey decides whether the bug occurred; no matching canned reply is required. Also make standalone mock fixtures select mocks explicitly and honor OMNIGENT_CONFIG_HOME, and make Claude onboarding honor CLAUDE_CONFIG_DIR.

flowchart LR
    Workflow[Workflow owner] --> Sandbox[Persistent sandbox: server, runner, mock]
    Shell[Independent agent shell] --> Relay[Temporary loopback relays]
    Relay -->|Shared Unix sockets| Sandbox
Loading

Workflow provisioning and finalization require a companion change in omnigent-internal; this PR supplies the runtime, connection wrapper, fixture attachment, and usage guide at dev/repro_env/README.md.

Test Plan

  • 13 configuration, transport, and existing Claude onboarding tests passed.
  • Two cold starts with four independent Bubblewrap calls each: 24 real Claude/Codex turns passed, including follow-up composer turns and terminal-originated turns, with eight finalized browser videos.
  • An intentional failed assertion preserved its video; a later call drove Codex against the same environment. A shortened lease stopped the sandbox and removed its sockets without an explicit stop request.
  • Pre-commit passed, including Pyrefly. Hosted reproduction and live-provider validation have not been run.

Demo

  • Visual demo attached below
  • Non-visual evidence provided below or in Test Plan
  • Not applicable — no behavioral change

Type of change

  • Bug fix
  • Feature
  • UI / frontend change
  • Refactor / chore
  • Docs
  • Test / CI
  • Breaking change

Test coverage

  • Unit tests added / updated
  • Integration tests added / updated
  • E2E tests added / updated
  • Manual verification completed
  • Existing tests cover this change
  • Not applicable

Coverage notes

Local integration validation used the actual prepared CI Bubblewrap configuration, installed native CLIs, existing browser parity journeys, and dummy unused external credential sources. Each browser invocation used a separate sandbox and shared the persistent runtime. The environment uses mock model responses, so these checks establish native integration rather than live-model behavior.

To validate through CI, use the companion internal workflow branch and set the upstream ref input to this PR's head. Inside the prepared environment, run either native parity journey through python -m dev.repro_env exec -- python -m pytest <test-node> --ui-skip-build --video=on --output=recordings/native.

Changelog

Native Claude sessions respect CLAUDE_CONFIG_DIR when preparing onboarding and workspace trust.

@github-actions github-actions Bot added the size/XL Pull request size: XL label Sep 21, 2026
Comment thread dev/repro_env/runtime.py
response = client.get(url)
if response.status_code == 200 and predicate(response):
return
except httpx.TransportError:
asyncio.create_task(copy(other, writer)),
]
await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)
except (OSError, ConnectionError):
@omnigent-ci

omnigent-ci Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Polly AI Review

Blocking issues

None identified in the documented reproduction workflow.

Security vulnerabilities

None demonstrated. The relays expose the environment through loopback listeners and owner-only Unix sockets. The onboarding change aligns the trust-file location with the configuration directory already used by Claude.

Non-blocking notes

  • Restarting with the same output directory fails after stop. dev/repro_env/__main__.py:58 creates a stop marker, but startup does not clear it. The cancellation check at dev/repro_env/runtime.py:129 then aborts the next startup. Reproduce with serve → stop → serve using the same output directory. Either support reuse by clearing a previous run’s marker safely, or document that each run requires a fresh directory.

  • The relay discards responses after a client half-close. At dev/repro_env/transport.py:47, completion of either copy task cancels the other. An offline probe that sent a request, called shutdown(SHUT_WR), and waited for a delayed response received no response bytes. This does not affect the documented browser and HTTP-client journeys, but limits other clients used through the wrapper. Consider forwarding the half-close while allowing the response direction to finish.

  • Fixture attachment supports only part of the existing fixture state. tests/e2e_ui/conftest.py:974 supplies connection information but omits fields such as pid, restart_server, and database_uri. Journeys using fixtures that require those fields can fail with a KeyError or an unrelated --ui-base-url diagnostic. Document the supported fixture subset or reject unsupported operations with an explicit reproduction-mode error.

Approach

The supervisor and per-call Unix-socket relays are a sound approach to keeping services alive across independent shell namespaces. Reusing the existing mock server and native fixtures keeps this aligned with the repository’s test infrastructure. No materially simpler alternative is evident.

Summary

The changes appear to satisfy the stated outcome, and the configuration fixes directly support that workflow. No blocking defect or security vulnerability was demonstrated. The main follow-ups concern output-directory reuse, relay half-close behavior, and fixture compatibility outside the documented journeys. Validation included reconstructing the changed files from the verified snapshot, syntax/import checks, and targeted offline transport probes; pytest and lint were not run, so this assessment does not independently confirm the reported test results.


Automated review by Polly · workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Pull request size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant