fix(trust): start no agent CLI in a repository you haven't trusted
Problem
vigent runs each agent CLI headless in a worktree of the repository, and headless CLIs skip their own "trust this folder?" prompt. So a repository's own agent config ran as soon as an agent started, with no :trust:
- Claude Code: a committed
.claude/settings.jsonSessionStart hook ran on agent start (confirmed). The same file can setenv,permissions.allowand MCP servers. - pi: a committed
.pi/extensions/*.tsran on agent start, and also onpi --list-models, which vigent runs from the repository root for:model, its Tab completion and:race --models(confirmed). - OpenCode and Gemini: probably load project config the same way.
Change
- vigent starts no agent CLI in a repository you haven't trusted, and runs no command that loads its project config there. That covers
:new, the start screen,:race, templates, forks, and restoring agents after a restart. - A clear message names the agent configs the repository carries (
.claude/,.pi/, …) and points to:trust. :trustandvigent trustnow also trust the repository itself. Model lists run from outside the repository, so:modelkeeps working.
Details follow as the commits land.
Status
Draft. In progress; the full checks run before this leaves draft.
Verification
To be filled in: tests in both languages, plus a pty test on both builds in which a repository's .claude/settings.json and a fake CLI prove nothing runs before :trust.
Follow-ups
The untrusted-actions fix (:new/:race/:merge/:pr from untrusted mappings, and model/effort flag validation) follows in its own PR.
Generated by Claude Code
Summary by cubic
Stops agent CLIs from running in a repository you haven't trusted. vigent launches each agent CLI headless in a worktree, and headless CLIs skip their own trust prompt, so a committed .claude/settings.json SessionStart hook or .pi/extensions ran on agent start with no :trust.
:trustandvigent trustnow also trust the repository itself (keyed by its path in the same store), even one with no.vigent.toml; outside a git repository, the folder vigent was started in counts, and your home and config folders are always trusted.- Until it's trusted, starting an agent (
:new,:race, forks, templates, engine switching) starts nothing and names the agent configs the repository carries;:racesays so before it reads its arguments. Agents reopened or reattached after a restart are shown but held, and their queued prompts go once trusted. - The engines' own commands (sign-in checks, model lists) run from a neutral folder until then, so
:modelstill works; demo mode is unchanged. vigent trust --listshows what's trusted, and--revoke [folder]forgets a repository's trust along with its.vigent.toml's.