Related to #68 (harness config parity), but independent of it.
Problem
The antigravity agent makes sandbox mock CLIs shadow real binaries by transiently mutating the whole process's PATH around the localharness spawn, serialized behind a process-wide lock. That was the right workaround when the SDK spawned the harness with no way to pass an environment. It no longer is, and the comments explaining it are now wrong.
Two costs:
- Parallelism. The lock is taken even when a run has no mock dirs, because an unmutated spawn would otherwise inherit another task's PATH window. Every antigravity harness start in host and tempdir mode serializes against every other one.
- Isolation. Mock-CLI shadowing is correct only while that lock holds. The environments are not separate, they are globally shared and time-sliced.
Claude-code and codex both pass an environment to their SDKs natively. Antigravity is the only harness faking it.
The SDK already supports this
Requested upstream in google-antigravity/antigravity-sdk-python#107 and shipped in google-antigravity 0.1.7, which is the version we already pin. No bump needed. The SDK merges the custom environment over the inherited one, so passing only PATH preserves today's behavior.
Changes
Pass the mock dirs to the SDK config as a per-agent environment, and delete the guard, the process-wide lock, and the stale comments.
Net effect is a deletion.
Verify
Mock CLIs still shadow real binaries on antigravity, two such tasks running concurrently each see only their own mock dirs, and harness starts no longer serialize (visible as wall-clock improvement on a multi-task antigravity run in parallel).
Relationship to #68
Same theme, and it touches the same config object that #68's antigravity tool-policy item does, so it makes a natural first PR in that push. Kept separate because #68 carries open design questions and a required landing order, while this is self-contained and ready now.
Related to #68 (harness config parity), but independent of it.
Problem
The antigravity agent makes sandbox mock CLIs shadow real binaries by transiently mutating the whole process's
PATHaround the localharness spawn, serialized behind a process-wide lock. That was the right workaround when the SDK spawned the harness with no way to pass an environment. It no longer is, and the comments explaining it are now wrong.Two costs:
Claude-code and codex both pass an environment to their SDKs natively. Antigravity is the only harness faking it.
The SDK already supports this
Requested upstream in google-antigravity/antigravity-sdk-python#107 and shipped in
google-antigravity0.1.7, which is the version we already pin. No bump needed. The SDK merges the custom environment over the inherited one, so passing onlyPATHpreserves today's behavior.Changes
Pass the mock dirs to the SDK config as a per-agent environment, and delete the guard, the process-wide lock, and the stale comments.
Net effect is a deletion.
Verify
Mock CLIs still shadow real binaries on antigravity, two such tasks running concurrently each see only their own mock dirs, and harness starts no longer serialize (visible as wall-clock improvement on a multi-task antigravity run in parallel).
Relationship to #68
Same theme, and it touches the same config object that #68's antigravity tool-policy item does, so it makes a natural first PR in that push. Kept separate because #68 carries open design questions and a required landing order, while this is self-contained and ready now.