feat: include [experimental_network] in <environment_context> (#11044)

If `NetworkConstraints` is set, then include the relevant settings on `<environment_context>`. Example:

```xml
<environment_context>
  <cwd>/repo</cwd>
  <shell>bash</shell>
  <network enabled="true">
    <allowed>api.example.com</allowed>
    <allowed>*.openai.com</allowed>
    <denied>blocked.example.com</denied>
  </network>
</environment_context>
```
This commit is contained in:
Michael Bolin
2026-02-08 15:16:50 -08:00
committed by GitHub
parent 9f1009540b
commit 181b721ba5
4 changed files with 166 additions and 37 deletions

View File

@@ -2204,9 +2204,9 @@ impl Session {
.into(),
);
}
items.push(ResponseItem::from(EnvironmentContext::new(
Some(turn_context.cwd.clone()),
shell.as_ref().clone(),
items.push(ResponseItem::from(EnvironmentContext::from_turn_context(
turn_context,
shell.as_ref(),
)));
items
}