Skip to content

feat(shell): one shell story — persistent session, confirm instead of refuse, one name for full access - #4408

Merged
itomek merged 38 commits into
mainfrom
kalin/shell-story-g3
Sep 28, 2026
Merged

itomek merged 38 commits into
mainfrom
kalin/shell-story-g3

Conversation

@itomek

@itomek itomek commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Three open PRs rewrite the same refusal branch in the agent's shell tool, and landing any two without the third leaves guard messages describing behaviour that no longer exists. This folds all three into one branch so the shell story can be reviewed and tested as one thing.

What a user gets. The agent stops refusing work you are sitting right there to approve: git commit, npm test, rm notes.txt are now shown to you and run once you say yes, instead of coming back as a flat "not allowed". A cd survives to the next command, so cd build && cmake .. followed by make works the way it reads. And the coding skill loads on a machine where pytest lives only in a virtualenv, which is most machines.

Replaces #3791, #3400 and #3808.

The one decision a reviewer should confirm

#3400 and #3808 forked 143 and 184 commits back, and main moved under both. Where the two disagreed about behaviour, main's newer design won and #3808's older expectations were updated:

If either call is wrong, it is a small edit here rather than a re-merge.

🔍 Technical details

Merge shape. #3791 (the only mergeable member) anchors; #3400 and #3808 were merged onto it in that order, each as a --no-ff merge whose message records its own resolutions.

One name for full access. Main carried console.bypass_permissions and #3808 added console.full_access for the same session-wide grant — the naive merge shipped both, which would have been a live bug (full_access_active() reading one while PermissionState wrote the other). Collapsed onto full_access, keeping main's semantics and #3808's name:

before after
console.bypass_permissions console.full_access
ShellToolsMixin.bypass_gates_active full_access_active
client.PermissionBypasser (Go) client.FullAccessSetter
SetBypassPermissions (Go) SetFullAccess
PermissionState.set_bypass set_full_access
stdio control verb bypass full_access

The HTTP route keeps its original /v1/{agent}/sessions/{id}/bypass spelling — renaming it would break every already-published sidecar. --bypass-permissions and the bypass control verb stay accepted as retired spellings.

Superseded, deliberately not carried over from #3808: _resolve_git_subcommand and SAFE_GIT_COMMANDS (main moved git into BINARY_POLICIES with a read-only ungranted floor), its git-subcommand branch, and its SPEC claim that /tool_decision and the session toggle are stdio-only (contract 2.14 gave HTTP both).

shell_session is a new bundle, not two more members of shell. Folding get_shell_state / reset_shell_session into shell put it at 7 members, over MAX_BUNDLE_MEMBERS — a cap that exists so one pull-in cannot exhaust the dynamic-tool slots. Registered tool count 86 → 88, with gaia-agent.yaml, gaia_agent/__init__.py, CAPABILITY_MATRIX.md and the guide updated together.

Two fixes that fell out of the merge rather than out of any of the three PRs:

  • Under full access a shell keyword (for, while) was reported as "not in the developer command set" instead of being named as control flow. _validate_bypass_command now names it, because no mode can run it.
  • wait_for_condition refused a confirmable predicate in front of the prompt — the same dead end the confirm tier exists to remove.

One stale test corrected: test_a_pipe_is_refused_for_its_binary_not_for_the_pipe asserted the exact grant-id refusal for pytest, which #3791 replaces with a "not installed" refusal wherever pytest is not on PATH. It passed in CI only because CI has pytest on PATH — exactly the hidden-state masking CLAUDE.md warns about. It now holds in both machine states.

Kalin Ovtcharov and others added 30 commits September 14, 2026 13:24
The coding skill was refused outright unless a pytest executable sat on the
global PATH, which is not where most projects keep it. In one benchmark run,
42 of 48 attempts to load it failed this way.

A command policy can now name a substitute. When the command is missing and a
substitute exists, the skill loads without that grant and load_skill tells the
model what to do instead: for pytest, run the suite through execute_python_file
with pytest.main. gh has no substitute, so a missing gh still refuses
github-triage.

Closes #3790

Co-Authored-By: Claude Opus 5 <[email protected]>
`git -C <path> branch` was refused as if `-C` were the subcommand, because
the validator read cmd_parts[1] without accounting for git's global options.
Any invocation carrying one — `-C`, `--git-dir`, `--work-tree`, `--no-pager` —
was blocked regardless of how read-only the actual subcommand was, so an agent
could only inspect git state in its own working directory.

The walk classifies each global option instead of skipping anything that looks
like a flag: value-taking options consume their value, `-c`, `--config-env` and
`--exec-path` stay refused (each can make git run an arbitrary command behind a
read-only-looking subcommand), and an unrecognized option is refused rather than
stepped over, so a future git release cannot shift the subcommand index unseen.
The agent could not do ordinary work its user was sitting right there to
approve. `git commit`, `npm test`, `rm notes.txt` were refused by
_policy_refusal, which runs *before* the confirmation prompt — so a gate that
would have asked never got the chance. Turning on full access
(--bypass-permissions / /bypass confirm) did not help: bypass only
short-circuits the prompt, and the refusal sits above it. The mode promised on
a permanent banner that the agent runs every tool without asking, then refused
anyway.

Blocked commands now carry the tier that decided them:

  CONFIRM      a write a prompt can describe exactly. Shown to the user,
               who answers y/n/always. Was refused; this is the change.
  REFUSE       an escalation a yes/no cannot honestly describe — gh auth
               token, base64 PowerShell, `git -c` running a script behind a
               status-looking subcommand. Full access lifts these.
  UNSUPPORTED  not a permission: the runner executes an argv list with no
               shell, so operators and bad quoting cannot run whoever
               approves them. Full access does NOT lift these — passing
               `cat a && rm b` through would execute `cat a '&&' rm b` and
               report success.

ALLOWED_COMMANDS stops being a refusal list and becomes what it always
described: the set that runs without asking. Default is unchanged in the only
direction that matters — nothing new runs unprompted, and full access stays off
unless asked for on this launch.
"Bypass permissions" named the mechanism, not the thing the user wants. It
reads as defeating a safeguard, so the mode people actually intend to run in
sounded like the one they shouldn't — and most sessions want it on.

  --bypass-permissions  ->  --full-access
  /bypass               ->  /full-access
  "BYPASS PERMISSIONS"  ->  "FULL ACCESS"   (banner, on every frame)

Nothing about the behaviour moves: still off on a fresh launch, still needs a
second explicit confirm to turn on, still carries the unscrollable banner.

Both old spellings keep working. The flag is a hidden alias onto the same
variable, `/bypass` stays in the command switch, and the agent's argparse
accepts either — the sidecar versions independently of this TUI, so a newer
agent can be handed the older flag by a TUI that shipped months ago. The flag
passed to the child process is deliberately still --bypass-permissions for the
same reason; factory.go says so where a future reader would otherwise "fix" it.
--full-access and /full-access confirm are per-launch by design: deliberate,
and gone when the session ends. That is right for trying it and wrong for
someone who works this way every day and re-types it every morning.

  gaia config set full_access true     # every session
  /full-access always                  # same, without leaving the TUI
  /full-access never                   # stop it coming back
  gaia --full-access=false             # skip it for one launch

This is the only thing that can turn the mode on without somebody asking for
it on that launch, so it is read ONLY from the user's own ~/.gaia/config.json.
A project-local .env or a checked-in config must never be able to switch off
another person's confirmation prompts. The banner is untouched — still drawn on
every frame — and the launch notice now names WHICH source turned it on and the
command that undoes that source, so "why is this on?" is always answerable.

Two things this found on the way:

`gaia config set full_access false` would have ENABLED it. Every CLI value
arrives as a string and GaiaConfig.set did a bare setattr, so the field held
"false" — truthy. Config fields are now coerced to their declared type, on
write and on load, and a value that is not a clear yes or no is refused rather
than guessed. `config set` also echoes what was stored rather than what was
typed, so `set full_access yes` confirms `= True`.

The TUI writes that file through a read-modify-write over the raw JSON object,
never a typed struct: profile, default_device, default_model and anything
Python adds later have to survive a write from Go untouched. A config that
does not parse is reported, not replaced.
Asking instead of refusing let a run approved only by GAIA_AUTO_APPROVE_TOOLS
start executing commands it used to refuse (rm, git push, npm), because that
variable answers every prompt. Those commands now stay refused when nothing
but the variable would approve them. An interactive yes, or the TUI's full
access (a person deciding), still runs them.

Removes this branch's own full-access lifting of the refuse tier. #3394 does
that part properly (operators, a developer binary set, an audit log) and
scopes it to the host's opt-in rather than the environment. "Unsupported"
folds back into refuse: it only existed to explain what full access could not
lift here.
"Bypass permissions" and "full access" were two names for one mode. It is
full access everywhere now: the TUI flag and command, the banner, the agent's
argv flag and control verb, the status line the agent shows after running a
tool unasked, and the code. --bypass-permissions and /bypass fail with a
one-line message naming the replacement. The agent answers the retired
control verb by turning full access OFF, so a TUI older than the agent can
never leave it on.

Main now refuses full access over the daemon transport, which is how a
Hub-installed flagship runs. A saved full_access: true fed that same check,
so the TUI would have refused to start, telling the user to drop a flag they
never passed. A saved default is now set aside on a transport that cannot
carry it, with a note in the chat; the explicit flag is still refused.
`chat --subprocess` checked only the old flag name and now checks
--full-access.
…y load path

The coding skill still told the model to run pytest directly, and a refused
pytest call told it to "load that skill first" even with the skill loaded, so
a model without pytest on PATH was pointed at a reload loop. Agents that load
skills from a manifest got no substitute at all.

- The loaded skill's prompt now carries a note naming the missing command and
  its substitute, rendered every turn, so the load_skill tool and manifest
  loads behave the same. The skipped grant is logged.
- The shell gate says a policed binary is not installed (with the substitute
  or install hint) instead of blaming a missing skill.
- coding SKILL.md makes direct pytest conditional on PATH and names the
  execute_python_file + pytest.main route; version 0.1.1.
- skill-format.mdx states the substitute exception to the missing-binary rule.
- unavailable_binaries is re-exported from gaia.skills.

Co-Authored-By: Claude Opus 5 <[email protected]>
`shutil` is already imported at module scope; the local one inside the
Unix-to-Windows command mapping shadowed it and failed Pylint's W0404,
which the code-quality gate treats as blocking.
The saved-preference check read an error only to test it for nil, which nilerr rejects as a swallowed error; it now asks the transport directly. A test assigned a submit result it never read.
… binaries a machine has

The not-on-the-allowlist case refused /usr/local/bin/python3.14 only where that binary was missing; on the macOS runner it existed and ran, because a command outside the no-prompt list now asks instead of being refused. It is replaced by a git global option refused on every machine, and the refused-pytest chain now refuses the way an unattended GAIA_AUTO_APPROVE_TOOLS run does. A new case pins that that refusal reports the check as not run.
…anted

classify_invocation ran after the grant check, so a REFUSE-tier call like
`gh auth token` escaped to the confirmation prompt whenever the binary had
no skill grant — a weaker outcome for an ungranted agent than a granted one.
Classify first: REFUSE is about what the command does, not who may run it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Main's allowlist fixes (#3593) keep refusing under this branch's ask-first
model: each guard it added is tagged as an outright refusal, so none of
them turns into a yes/no prompt. The /agents switch (#3987) and the
conversation-clear test (#3650) now use the full-access names, and a
saved-default notice is shown once rather than again on every switch.
…g the shell refuses

An embedder that passes auto_approve_gated_tools=True could run any
confirmable shell command with nobody asked; it now gets the same narrow
treatment as GAIA_AUTO_APPROVE_TOOLS, and only the TUI's full access (a
new full_access flag the stdio host sets alongside auto-approve) runs
commands off the read-only list unasked. A refused invocation stays
refused however the program is spelled (a path, .exe, pwsh), and a block
with no tier is refused rather than offered at the prompt.

The project map no longer tells the model that installed tools like npm
are refused. config.json and the TUI now agree that only a JSON boolean
turns full access on. Also: the factory comment matches the flag it
documents, one implicit string concatenation is joined, and the docs that
still described a refuse-only shell are corrected.
Conflict in docs/guides/gaia.mdx: kept this branch's ask-instead-of-refuse description of run_shell_command and appended main's run_python sentence. shell_tools.py was not touched on main since the last merge.
# Conflicts:
#	src/gaia/agents/tools/shell_tools.py
#	src/gaia/skills/binaries.py
Main had already replaced several things this branch was rewriting, so those
hunks were dropped rather than stacked: `_is_granted_segment`/`policy_argv`
supersede the branch's `_is_granted_binary`, `_path_traversal_refusal`
supersedes its inline path block, and `_parse_line`/`_split_connectors`
supersede its inline operator refusal and `shlex` splitter. Main's `&&`/`||`/
`;` chaining also supersedes the branch's blanket "shell operators are not
allowed" refusal.

Kept from the branch: the three-tier model, `_program_behind` alias recursion,
classify-before-grant ordering, and the blanket-approval gate. Two tests that
asserted now-superseded behaviour were re-pointed at operators that are still
refused rather than deleted.

One merge-only defect fixed: `_shell_command_refusal` returned main's
`(error, [])` for a parse error, which under this branch's tier model let a
TIER_CONFIRM line pass the exec gate with no steps and report success having
run nothing. It now returns `(error, steps)`.
A command the user is asked to approve was running nothing at all. It reported
success, wrote no file, and produced no output.

The merge took main's `return error, []` from `_shell_command_refusal`. Under
this branch's tier model a TIER_CONFIRM error still passes the exec-path gate,
so the caller went on to iterate `zip(steps, step_cwds)` over an empty list --
zero steps, zero commands run, `status=success`.
A shell tool embedded in a host with no console ran `rm -rf /`, `git push`
and `pytest` without anything ever asking a person, because the guardrail
read "nobody granted a blanket approval" as "a real human will be asked".

- `_approval_is_blanket_only` now returns True when `console is None`: no
  console means no surface to show the CONFIRM-tier prompt on, so the
  confirmation that tier assumes never happened (#2210).
- The refusal hint splits on the reason, so a console-less host is told it
  has no prompt surface rather than being blamed for auto-approval.

This restores the invariant the PR's own tests assert — a direct tool call
never skips the same rule — which is what the three unit lanes were failing
on: main's POSIX-only compound-command and env-assignment tests construct a
bare `ShellToolsMixin()` and expect the block to hold.
The console-less case was folded into the blanket-pre-approval check, so
the pre-flight refused every CONFIRM-tier command on a host that has no
console -- including the ones a caller's own gate was about to ask about.

Split the two paths: the pre-flight only refuses an actual blanket
pre-approval and leaves a missing console to the confirmation gate, which
denies it itself (#2210); the execution path keeps refusing both, since a
direct tool call proves that gate was never consulted.
Every run_shell_command call started from the process cwd, so a `cd build`
in one call was invisible to the next -- an agent working through a
build/test loop had to re-derive its location every turn. A ShellSession
now tracks that one thing across separate calls: the working directory a
chain's cd's leave it in.

Reconciles #3380's original persistent-session design (a real shell
running a generated script, its cwd/environment parsed back out of a
state-dump file) against main's since-added multi-step connector engine
(&&/||/; parsed and executed per-step as argv, never through a shell).
Those two are incompatible: the old design needs a real shell to capture
state FROM, and handing a command string to one is exactly what the
connector engine's argv-only execution exists to avoid (it is also what
lets a skill-granted CLI run on untrusted text without a shell ever
seeing it). So this keeps the connector engine untouched byte-for-byte --
validation, per-step execution, the granted-CLI carve-out, none of it
changes -- and reduces ShellSession to a plain cwd holder that
checkpoints the walked terminal directory after a clean run.

Scope, deliberately narrower than the original design: cwd only. No
generic `export`/venv-activation persistence -- that needs a real shell
to observe the change from, which the security model here doesn't allow
back in. A future PR can revisit explicit variable persistence
(`set_shell_variable`) once the two independently-maintained env-var
blocklists in this codebase (main's inline-assignment denylist vs. the
one the original design shipped) are unified rather than duplicated a
third time.

Adds get_shell_state (read the session's cwd) and reset_shell_session
(return to the starting directory). A cwd from a timed-out chain is
never checkpointed: the pre-flight walk resolves every `cd` on the line
before anything runs, so its terminal value can already reflect a `cd`
that comes after the step that never finished.
…istry

The new tools from the shell-session reconciliation were never added to a
bundle, so they were unreachable via load_tools and CI's coverage guard
(test_core_and_bundles_cover_doc_registry_exactly /
test_core_and_bundles_cover_the_flagship_registry_exactly) correctly
failed on both the chat and flagship agents.

Registry size grows 80 -> 82; updates the manifest's tools_count, the
registry's own declared count, the doc guide's tool table and counts, and
adds the missing CHANGELOG entry for the underlying feature.
# Conflicts:
#	src/gaia/agents/tools/skill_library_tools.py
# Conflicts:
#	hub/agents/gaia/python/gaia_agent/stdio.py
Resolves the tool-count conflict main and this branch each moved: main added
capture_skill (8 skill-library tools), this branch adds get_shell_state and
reset_shell_session (61 in the chat full profile). Merged total is 83, which
the real-registry gate confirms.

The hard-coded _EXPECTED_TOOLS_TOTAL and the generated CAPABILITY_MATRIX.md
were both still at 81 — this branch never updated them, so the merge would
have gone red on main.
The checkpoint used the pre-flight walk, which resolves every cd on the line
before anything runs. A cd that `&&`/`||` skipped therefore still moved the
session: `ls <missing> && cd build` left the next call in `build` even though
the `cd` never ran. Track the cwd the executed steps reached instead.

Also documents the persistent session in the shell-tools spec, which still
said a cd moves its own line and nothing else.
Both sides changed how a missing binary is explained to the model, so the
resolution keeps both intents rather than either one.

- main taught `python -m pytest` and maps that spelling onto the pytest
  grant, so an absent pytest refuses it too. The substitute text now says
  so and points at execute_python_file, which works wherever pytest is
  importable.
- The shell refusal keeps main's grant-route message ("load skill X") for
  an installed-but-ungranted binary, and uses this branch's
  not-installed message only when the binary is genuinely absent —
  reloading a skill cannot fix that.
- main's three grant-route tests now pin gh onto PATH; without that the
  not-installed refusal would answer first on a runner that lacks gh.
#3808 forked 184 commits back, so most of this was replaying its intent onto
work main has done since. Three parts of it were superseded outright and are
NOT carried over: `_resolve_git_subcommand`/`SAFE_GIT_COMMANDS` (main moved git
into `BINARY_POLICIES` with a read-only ungranted floor), its git-subcommand
branch, and its claim that /tool_decision and the session toggle are
stdio-only (contract 2.14 gave HTTP both).

One name for full access, for real. Main carried `console.bypass_permissions`
and #3808 added `console.full_access` for the same session-wide grant; the
merge would have shipped both. They are collapsed onto `full_access`, with
main's semantics (#3373/#3374: swaps the read-only allowlist for
DEVELOPER_COMMANDS and lifts the operator block) and #3808's name.
`bypass_gates_active` -> `full_access_active`, `PermissionBypasser` ->
`FullAccessSetter`, `SetBypassPermissions` -> `SetFullAccess`, `set_bypass` ->
`set_full_access`, and the stdio control verb `bypass` -> `full_access` in the
shared wire fixture both languages check. The HTTP route keeps its original
`/sessions/{id}/bypass` spelling — renaming it would break every published
sidecar.

Where the two PRs disagreed about behaviour, main wins:

- `git push` stays refused outright rather than becoming confirmable. #3374
  made push/reset/rebase refusals the git grant itself will not run.
- Full access keeps DEVELOPER_COMMANDS rather than lifting the allowlist
  entirely, so `rm` and `touch` stay out. #3808's own later commit
  ("keep unattended runs narrow; leave shell lifting to #3394") says this is
  where it expected to land.

Two real fixes fell out of the merge rather than out of either PR:

- Under full access a shell keyword (`for`, `while`) was reported as "not in
  the developer command set" instead of being named as control flow. The
  bypass validator now names it, because no mode can run it.
- `wait_for_condition` refused a confirmable predicate in front of the prompt,
  the same dead end the confirm tier exists to remove.
@github-actions github-actions Bot added documentation Documentation changes cli CLI changes tests Test changes agents tui Go terminal UI (gaia-tui) sidecar Agent sidecar contract / harness labels Sep 28, 2026
@itomek itomek added the ready_for_ci Run CI workflows on draft PR without requesting review label Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Skill audit

Skill Verdict Claimed tier Cleared tiers Findings Rules
hub/agents/gaia/npm ✅ ALLOW experimental experimental 1 high body.injection.credential_request

✅ All audited skills cleared the tier they claim.

Per-finding detail is withheld here on purpose. Read it in the Security > Code scanning tab, or download the skill-audit-reports artifact from this run. Offending source text is withheld from CI everywhere — reproduce it locally with gaia skill audit <dir> --show-snippets.

@itomek
itomek marked this pull request as ready for review September 28, 2026 18:11
The persistent shell session adds get_shell_state and reset_shell_session to
every profile that carries ShellToolsMixin, so chat/doc/file and the full
profile's yaml literal all move. The 'full' literal was already one behind on
main (62 declared, 63 real); it is now the real 65.
@itomek

itomek commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

Evidence

All three behaviours driven through the real tool surface on this branch — not mocks, not unit tests.

1. A cd survives to the next separate call (#3400) — run_shell_command, get_shell_state and reset_shell_session called in sequence against a real temp tree:

$ cd build            -> success | cwd: /tmp/g3evidence-4wimywrl
$ get_shell_state     -> /tmp/g3evidence-4wimywrl/build
$ cat marker.txt      -> success | stdout: found me
$ cat (working_directory override) -> success (one-shot, not the session)
$ get_shell_state     -> /tmp/g3evidence-4wimywrl/build (override did not move it)
$ reset_shell_session -> /tmp/g3evidence-4wimywrl

The cat marker.txt succeeded with no path — the session was still in build/. The explicit working_directory call ran and left the session where it was.

2. A describable write asks; an escalation still never does (#3808) — _validate_shell_command on a host with full access off:

  git commit -m wip                    tier='confirm'   -> user is asked
  npm test                             tier='confirm'   -> user is asked
  rm notes.txt                         tier='confirm'   -> user is asked
  gh auth token                        tier='refuse'    -> refused before any prompt
  git -c core.pager=evil.sh status     tier='refuse'    -> refused before any prompt
  git push origin main                 tier='refuse'    -> refused before any prompt

3. The coding skill loads with pytest only in a virtualenv (#3791) — on this machine pytest is genuinely not on PATH:

pytest on PATH?          None
pytest inside the venv?  True

coding SKILL.md declares: shell:execute:pytest
WARNING | Skill 'coding' loaded without its 'pytest' grant: 'pytest' is not on PATH.
          The model is told to use the substitute instead.
resolve_binary_policies : []  <- no exception: the skill LOADS
🔍 Test runs behind this

Go — built, vetted and tested on a real AMD Strix Halo box (Ubuntu 24.04, go1.26.3):

go build ./...   -> BUILD_OK
go vet ./...     -> clean

ok  internal/catalog · cli · client · control · daemon · event · gaiainit
ok  gaiaslack · lemonade · ui · ui/agents · ui/brand · ui/cards
ok  internal/ui/chat        (-skip TestCtrlVReadsTheClipboard)
ok  internal/ui/components · ui/theme · ui/root
ok  internal/ui/preflight   (-run "FullAccess|ReadFullAccess")
ok  tui/test                112.8s   <- the end-to-end full-access transport tests
ok  tui/test/mockagent

Two packages hang headless for reasons this branch does not touch (no commits against either file): TestCtrlVReadsTheClipboard reads the machine's real clipboard (paste_test.go:99), and preflight's autostart_test.go / local_test.go dial the network. Both were skipped, not ignored — everything else in those packages passes.

The Go suite caught one thing worth naming: tests/fixtures/stdio/gaia_stdio_wire.json pins the stdio control verb that both languages check, so renaming bypass → full_access on the Go side failed until the fixture and the Python reader moved with it. That fixture is why the rename is complete rather than half-applied.

Python — full unit + hub suite, branch vs origin/main, same interpreter, same flags (-p no:randomly), run from a second worktree so neither could import the other's source:

main   : 35 failed, 17686 passed, 151 skipped, 3 xfailed, 2 errors  (22:27)
branch : 35 failed, 17797 passed, 151 skipped, 3 xfailed, 2 errors  (22:05)

Identical failure sets. The 35 are pre-existing on this machine (profile-spec goldens, token-budget baselines, a lemonade start-hint, a wheel-import probe) — each verified failing on origin/main too. +111 passing are this branch's new tests.

The differential's first pass did surface 3 branch-only failures, all one bug: the chat profiles' hand-typed tools_count literals hadn't followed the two new tools. Fixed in 2746b800, which also corrected a count that was already one behind on main (62 declared, 63 real).

Lint: python util/lint.py --all reports exactly one critical error on this branch, and the identical one on origin/main — read_tool_output's description is 469 chars against a 400 budget. Pre-existing, untouched here.

The project map now says 'Read-only commands for run_shell_command' and
lists the rest as commands that run once the user approves, because that
is what the shell tool does since the confirm tier landed.
@itomek

itomek commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

CI status, so the red checks aren't mistaken for this change.

Everything that passes on main passes here. Four things are red, none of them caused by this PR:

  • 8 × Scenario eval - * and the baseline gate — the eval judge is out of credit repo-wide; every lane fails in ~45s without measuring anything.
  • Test Gaia Agent — three test_lemonade_start_hint tests error on gaia_agent.stdio having no describe_start_hint. That attribute is absent on origin/main too (grep -c returns 0 on both).
  • Unit Tests (Windows smoke) / (macOS smoke) — already red on main; the Linux job was cancelled by the matrix, not failed.
  • Test Agent SDK on Windows (Lemonade Integration) — needs hardware this runner doesn't have.

The signal that does cover this change is in the evidence comment: the full Python unit + hub suite run against this branch and against origin/main back to back, same interpreter and flags, produced identical failure sets (35 each), with +111 passing here. Go was built, vetted and tested on a real Strix Halo box.

@itomek
itomek added this pull request to the merge queue Sep 28, 2026
Merged via the queue into main with commit 2927f1a Sep 28, 2026
70 of 84 checks passed
@itomek
itomek deleted the kalin/shell-story-g3 branch September 28, 2026 19:00
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Sep 29, 2026
Under full access, `python3 - <<'EOF'` and similar heredocs were refused:
the body was walked as more shell text, so an apostrophe inside it broke
tokenising and a body containing `;`, `&` or `|` fractured the heredoc
into extra segments the gates then evaluated as their own commands.

A heredoc body is now treated as input to the command that opened it,
not a command of its own. The body is stripped only for the walk that
picks out which binaries run (`_strip_heredoc_bodies`) and its operator
characters are neutralised only for the connector split that decides
where one command ends and the next begins (`_mask_heredoc_connectors`,
position-preserving so a split point found there still slices the real
command correctly). The step that actually executes keeps the original,
unstripped text throughout.

Reconciles the design amd#4408 already settled on: the developer command
set stays (main's decision, kept as-is here), this only closes the
heredoc gap that was never part of that consolidation.
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Sep 29, 2026
The old branch forked before amd#4408 consolidated the shell full-access
rewrite (which folded amd#3808 and kept the developer-command-set design
over the alternative this branch's history argued for) and before the
connector-splitting refactor that landed with it. Rather than resolve
~48 files of conflicts against designs main has already settled, this
takes current main plus a fresh, correctly-scoped heredoc fix as the
tree, recorded as a merge so the branch's history and this PR are not
orphaned.
@kovtcharov-amd kovtcharov-amd mentioned this pull request Oct 6, 2026
5 of 10 tasks
grtninja pushed a commit to grtninja/gaia that referenced this pull request Oct 6, 2026
# GAIA v0.25.0 Release Notes

## Breaking Changes

- **`gaia chat` runs the flagship GAIA agent**, the same agent as the
TUI and Agent UI, instead of the retired ChatAgent. `gaia chat -q "…"`
queries it once. (PR [amd#4520](amd#4520))
- **`gaia talk` transcribes and speaks through Lemonade** — it uses
Lemonade's Whisper and `kokoro-v1`, and stops with the reason if
Lemonade is down. The `[audio]` extra is gone; `pip install
amd-gaia[audio]` only warns. (PR
[amd#4665](amd#4665))
- **The Agent UI runs only the GAIA agent** — the Agent Hub home, agent
picker, and custom-agent export/import are removed from the UI. The CLI
and eval harness can still run other agents. (PR
[amd#4509](amd#4509))
- **The retired nomic embedder is removed** — memory saved with it is
re-embedded on first start. (PR
[amd#4489](amd#4489))
- **Indexed documents are re-indexed once** — the document cache is now
keyed on chunking settings, so the first query after upgrading rebuilds
it. (PR [amd#4624](amd#4624))
- **A skill that asks for more than its tier allows no longer loads** —
the permission ceiling is checked at every load, so a skill already on
disk that exceeds it is refused with the reason. (PR
[amd#4849](amd#4849))

## What's New

- **A larger local model where the GPU holds it** — `gaia init` picks
Qwen3.6-35B-A3B on a 64 GB+ Strix Halo or a 32 GB GPU and keeps
Gemma-4-E4B elsewhere, with each context window sized to available
memory. Qwen3.8 Flash Next is opt-in on 128 GB Strix Halo. (PRs
[amd#4479](amd#4479),
[amd#4670](amd#4670),
[amd#4671](amd#4671),
[amd#4658](amd#4658),
[amd#4655](amd#4655))
- **The Agent UI opens straight to a chat and sets itself up** — a fresh
install runs the same setup steps as the TUI in the window, with
provider, key and model settings, permission modes, and revocable
"always allow" grants. (PR
[amd#4509](amd#4509))
- **A much smaller install** — PyTorch, transformers and accelerate are
gone from the core, `[ui]` and `[talk]` installs; the desktop app's
Python environment drops from ~0.9 GB to ~0.1 GB on Windows. (PRs
[amd#4666](amd#4666),
[amd#4621](amd#4621),
[amd#4665](amd#4665))
- **One Windows installer for the desktop app and the terminal**, with a
GAIA Windows Terminal profile. (PRs
[amd#4720](amd#4720),
[amd#4707](amd#4707))
- **A "no" holds** — a declined action isn't retried through another
tool; the agent asks again with the exact command. The TUI gains
Shift+Tab permission modes. (PRs
[amd#4460](amd#4460),
[amd#4461](amd#4461))
- **Answers are checked against what the tools actually did** — the
agent looks at files you name before answering about them, and a short
plain-English note appears only when work isn't confirmed. (PRs
[amd#4532](amd#4532),
[amd#4501](amd#4501),
[amd#4508](amd#4508))
- **One shell session** — commands share a persistent shell, risky ones
ask instead of being refused, and "full access" is one setting
everywhere. (PR [amd#4408](amd#4408))
- **Memory surfaces what's relevant to each request, with its age**,
keeps what fixed a failure as a lesson for that workspace, and extracts
after the answer instead of before it. (PRs
[amd#4061](amd#4061),
[amd#4066](amd#4066),
[amd#4406](amd#4406))
- **`gaia.log` stays bounded** — it rotates at 10 MB with three backups
(`GAIA_LOG_MAX_MB`, `GAIA_LOG_BACKUPS`). (PRs
[amd#4668](amd#4668),
[amd#4760](amd#4760))
- **Child processes get a trimmed environment** — shell, MCP and skill
children no longer inherit GAIA's internal credentials; `GAIA_NO_DOTENV`
skips loading `.env`. (PRs
[amd#4635](amd#4635),
[amd#4659](amd#4659))
- **Every file tool checks the allowed-folders rule**, and paths inside
an inline shell script are checked one by one. (PRs
[amd#4656](amd#4656),
[amd#4758](amd#4758))

## Bug Fixes

A selection of the user-visible fixes; the full list is in the changelog
below.

- **Local Qwen models no longer loop on repeated tool calls** — they run
with their model card's sampling instead of near-greedy settings. (PR
[amd#4655](amd#4655))
- **Qwen3.6 runs on a Strix Halo with an older AMD driver** — it used to
crash on its first token, so `gaia init` failed; GAIA now turns off the
Vulkan path that crashes on those drivers only, and newer drivers keep
the faster path. (PR [amd#4674](amd#4674))
- **A long PDF no longer hangs or times out while indexing** — big
documents index in the background, and PDFs that only carry
owner-password restrictions now index. (PRs
[amd#4754](amd#4754),
[amd#4679](amd#4679),
[amd#4734](amd#4734))
- **Document answers cite the right document and page**, and every chunk
is embedded whole instead of its first 1,200 characters. (PRs
[amd#4688](amd#4688),
[amd#4723](amd#4723))
- **`gaia init` fails when model verification fails**, shows downloads
live, and no longer hangs while Lemonade hashes a large model. (PRs
[amd#4620](amd#4620),
[amd#4564](amd#4564),
[amd#4673](amd#4673))
- **`gaia init` adds a profile's extras without reinstalling GAIA**,
which failed on Windows while `gaia.exe` was running. (PR
[amd#4672](amd#4672))
- **Every SDK and CLI entry point starts GAIA's own Lemonade**, and
every call goes to the resolved URL with its API key. (PRs
[amd#4657](amd#4657),
[amd#4627](amd#4627))
- **Local chat stays cached across turns** — the system prompt is fixed
and side requests no longer evict the conversation. (PRs
[amd#4698](amd#4698),
[amd#4543](amd#4543))
- **A cloud model selection never preloads a local model**, and cloud
models no longer get llama.cpp-only fields. (PRs
[amd#4757](amd#4757),
[amd#4709](amd#4709))
- **The Agent UI stops claiming "100% local" while chat goes to a cloud
model**, and the chat header names the session's real model. (PRs
[amd#4711](amd#4711),
[amd#4550](amd#4550))
- **Enter can't approve a permission prompt**, and prompts wait 10
minutes before timing out. (PRs
[amd#4700](amd#4700),
[amd#4699](amd#4699))
- **Stopping a run keeps the turn and its steps visible.** (PR
[amd#4743](amd#4743))
- **A file edit keeps the file's line endings** — a one-line edit on
Windows used to rewrite every line ending, so a small change showed up
as the whole file changed. (PR
[amd#4864](amd#4864))
- **A broken agent install is reported as broken, not as missing** — the
error names both package versions and the real import error, and
suggests a reinstall that works. (PR
[amd#4588](amd#4588))
- **A meeting or document summary is never cut off mid-sentence** — a
thinking model used to spend the summary's output budget reasoning, so a
long meeting lost its second half. (PR
[amd#4827](amd#4827))
- **"What can you do?" gets an answer** instead of an attempt to
generate an image of the question. (PR
[amd#4809](amd#4809))
- **Writes and approved edits can't reach credential folders**
(`~/.ssh`, `~/.aws`, `~/.kube` and others), and shell option values and
script arguments get the same path check as plain paths. (PRs
[amd#4848](amd#4848),
[amd#4847](amd#4847))
- **`gaia connectors connect google --grant-agent installed:gaia`
works** — it used to fail with no sign-in link for the shipped agent; it
now asks for read-only Gmail and grants exactly that. (PR
[amd#4859](amd#4859))
- **A "no" to creating a folder also covers writing into it** — GAIA no
longer asks again to create the same folder a different way. (PR
[amd#4857](amd#4857))
- **`gaia skill import` runs the same checks as a hub install** — https
only, the audit, the permission ceiling, and an explicit opt-in for
skills that ship code. (PR
[amd#4849](amd#4849))
- **Memory off and private chats apply to scheduled and background runs
too.** (PRs [amd#4842](amd#4842),
[amd#4821](amd#4821))
- **Memory stops false apologies and reusing deleted values**, saves
"remember this" requests, and skips loading the embedder when memory is
off. (PRs [amd#4708](amd#4708),
[amd#4756](amd#4756))
- **A reply cut off by the token limit is continued** instead of ending
mid-sentence, and a tool call cut off at the output cap is retried
shorter. (PRs [amd#4054](amd#4054),
[amd#4556](amd#4556))
- **The TUI remembers the chosen model** across restarts and
agent-process restarts. (PRs
[amd#4497](amd#4497),
[amd#4710](amd#4710))
- **`gaia uninstall --purge` removes installer binaries, PATH edits and
daemon state.** (PR [amd#4413](amd#4413))

## Contributors

Thanks to the community members who contributed to this release:

- [@itomek](https://github.com/itomek) — the flagship's browser and tool
picker, one shell session, memory extraction off the answer path, stale
tool-result eviction, the TUI's sourced Fireworks rankings, and
`--purge` cleanup (PRs [amd#4407](amd#4407),
[amd#4408](amd#4408),
[amd#4406](amd#4406),
[amd#4465](amd#4465),
[amd#4414](amd#4414),
[amd#4413](amd#4413))
- [@mikemikimike](https://github.com/mikemikimike) — chained shell
command timeouts, bundled skills in frozen builds, and sidecar cleanup
reporting (PRs [amd#4463](amd#4463),
[amd#4467](amd#4467),
[amd#4419](amd#4419))
- [@Hashim1999164](https://github.com/Hashim1999164) — honoring
`GAIA_HOME` for cache, chat and index paths (PR
[amd#4381](amd#4381))
- [@krtadev](https://github.com/krtadev) — `~` expansion in file and
document tool paths (PR [amd#4576](amd#4576))
- [@aksh8b](https://github.com/aksh8b) — telling a broken agent install
apart from a missing one, with a reinstall hint that works (PR
[amd#4588](amd#4588))
- [@Dev-next-gen](https://github.com/Dev-next-gen) — numeric prerelease
ordering in the hub (PR [amd#4517](amd#4517))
- [@vianmangal](https://github.com/vianmangal) — recording denied tool
calls as unsuccessful in memory (PR
[amd#4412](amd#4412))
- [@GaetanVDB07](https://github.com/GaetanVDB07) — links to upstream
credential setup guides for connectors (PR
[amd#4669](amd#4669))
- [@rradjabi](https://github.com/rradjabi) — moving self-hosted CI jobs
to the xsj-dispatch runner pool (PR
[amd#4534](amd#4534))




## Also in this PR

- **Hub floors raised to core 0.25.0** — the chat agent imports the
allowed-folders check that only 0.25.0 ships (amd#4656), so
`gaia-agent-chat` goes to 0.2.0 with `amd-gaia>=0.25.0`, and the
flagship requires `amd-gaia>=0.25.0` and `gaia-agent-chat>=0.2.0`.
- **Two follow-ups held back until that floor could rise** —
`~/.gaia/logs/gaia-agent.log` now rotates like `gaia.log` (amd#4668), and
the chat agent's Python runners and Windows notification start their
children without GAIA's internal credentials (amd#4659).

The full changelog (300 commits) is in `docs/releases/v0.25.0.mdx`.

## Test plan

- [x] `util/validate_release_notes.py docs/releases/v0.25.0.mdx --tag
v0.25.0` passes; narrative is 590 words (cap 600)
- [x] `util/check_component_core_api.py --release-version 0.25.0` passes
- [x] `pytest tests/unit/test_docs_json_release.py
tests/unit/test_check_component_core_api.py
hub/agents/chat/python/tests/test_chat_dependency_floor.py
hub/agents/chat/python/tests/test_dependency_floor.py
hub/agents/gaia/python/tests/test_gen_binaries_lock.py` (72 passed)
- [x] `pytest hub/agents/gaia/python/tests/test_stdio.py` (91 passed,
incl. the new rotation test); `pytest
tests/unit/test_execute_python_file_cwd.py
tests/unit/test_run_python_tool.py` (42 passed)
- [ ] `mintlify validate` (docs CI job) — timed out locally, relying on
CI
- [x] Full flagship eval on main 9ce6598
(https://github.com/amd/gaia/actions/runs/37436249503): 181/308
scenarios pass vs 100/183 for the same categories in the baseline, 39
FAIL→PASS, 13 PASS→FAIL (two fixed in amd#4878, held until after rc1);
retrieval lane still finishing at merge time
- [ ] CI green

## Release checklist

- [ ] Publish `gaia-agent-chat` 0.2.0 only after core 0.25.0 is on PyPI
— it fails at import on an older core
- [ ] Build Installers on the merged SHA (pre-tag verification) before
pushing `v0.25.0`
- [ ] terminal-hub 0.25.0 published before the flagship npm release
consumes `binaries.lock.json`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents cli CLI changes documentation Documentation changes ready_for_ci Run CI workflows on draft PR without requesting review sidecar Agent sidecar contract / harness tests Test changes tui Go terminal UI (gaia-tui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants