Skip to content

[pull] main from xintaofei:main - #159

Merged
pull[bot] merged 1 commit into
MoozLee:mainfrom
xintaofei:main
Jul 25, 2026
Merged

[pull] main from xintaofei:main#159
pull[bot] merged 1 commit into
MoozLee:mainfrom
xintaofei:main

Conversation

@pull

@pull pull Bot commented Jul 25, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

The ACP `fs/read_text_file` / `fs/write_text_file` handlers confined every
path to the session working directory, with no way to configure it. Agents
that keep state outside any workspace could not use the channel codeg
advertises to them: Grok's plan mode writes
`<GROK_HOME>/sessions/<cwd>/<id>/plan.md` and reads `<GROK_HOME>/skills`,
so those calls failed and Grok fell back to writing the file through a
shell heredoc instead.

- Replace the single hardcoded root with an `FsAccessPolicy`. Reads are
  unrestricted by default; writes are limited to the workspace, the agent's
  own data home, the temp dirs, and any user-listed extra roots. The
  16MB/2MB size caps and the parent-directory rules are unchanged.
- Add `CODEG_ACP_FS_POLICY` (`default` | `strict` | `unrestricted`) and
  `CODEG_ACP_FS_EXTRA_ROOTS`. Both resolve from the agent's `env_json`
  before codeg's own environment, so they can be set per agent from the
  existing settings UI; `strict` restores the previous behavior.
- Derive each agent's data home from a declarative table that mirrors the
  resolvers in `parsers/`, carrying every relocation variable in its
  resolver's precedence order plus the sub-path and trim semantics that
  resolver applies. A test pins the table against those resolvers so the
  two cannot drift.
- Track the environment the launched child actually sees: a non-blank
  `runtime_env` value replaces the parent's, a blank one is removed by the
  spawn layer so the agent falls back to its own default, and an absent one
  is inherited. Home-relative defaults follow the child's `HOME` /
  `USERPROFILE` rather than codeg's, so an isolated profile stays isolated
  and the inactive one is not writable.
- Refuse a root that cannot be named safely instead of guessing: relative
  values are never resolved against codeg's cwd, and values are never
  trimmed or tilde-expanded, either of which could widen a root to `$HOME`
  or `/`. Containment is still checked on the canonicalized target, so a
  symlink leading out of an allowed root is rejected.
@pull pull Bot locked and limited conversation to collaborators Jul 25, 2026
@pull pull Bot added the ⤵️ pull label Jul 25, 2026
@pull
pull Bot merged commit 2b01744 into MoozLee:main Jul 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant