Skip to content

fix(tui): proportionate permission prompts, Shift+Tab modes, timeouts as timeouts - #4461

Merged
kovtcharov-amd merged 22 commits into
amd:mainfrom
kovtcharov:kalin/permission-prompts-4446
Oct 5, 2026
Merged

kovtcharov-amd merged 22 commits into
amd:mainfrom
kovtcharov:kalin/permission-prompts-4446

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4446

Running a project's tests used to raise a DESTRUCTIVE prompt that printed the command twice, wrapped a temp path over three lines, offered only "run once", and — if nobody answered in 10 minutes — told the agent the user had refused. Now the prompt says what the command does (RUNS CODE), shows it once relative to the project, offers y once · a always · n deny on shell and Python prompts too, and an expired prompt is reported as a timeout. Shift+Tab cycles ask → accept edits → full access, with the mode on the status bar; full access still turns on only after it has been confirmed once this session (or at launch), and commands GAIA refuses stay refused in every mode but full access.

  • a covers a command family, not a spelling. Approving python -m pytest also covers cd proj && pytest 2>&1 | tail, so one answer ends the stream of prompts in a bugfix turn. Deletes, lines GAIA can't read, and file redirects never get it; interpreter grants say they cover any script.
  • Accept edits lets file edits inside the starting folder run unasked — never .git/, a PATH folder, or (on Windows) a file that would shadow a real program.
  • Docs: terminal-hub guide, the CLI reference's full-access section plus the TUI flags The TUI's --use-claude, --claude-model, --bypass-permissions and --dev flags are documented nowhere on the docs site #3140 flagged as undocumented, the stdio contract, and the hub agent's SPEC/SKILL/CHANGELOG.

Aligned with #4050 on the presets and on full access never being one stray keypress away. Two deliberate differences, since #4050 isn't signed off: a is offered for inline Python (the issue asks for it on every prompt type; the label says "any inline Python"), and Shift+Tab reaches full access once it is unlocked rather than never.

Test plan

  • cd tui && go test ./... — includes frame tests for the new prompt, the Shift+Tab cycle, timeout delivery, and the status bar never clipping Ctrl+C quit
  • python -m pytest tests/unit/agents/test_tool_grants.py tests/unit/agents/test_call_risk.py tests/unit/chat/ui/test_confirmation_summary.py tests/unit/test_stdio_permission_control.py hub/agents/gaia/python/tests/test_stdio_wire_contract.py
  • python util/tui_driver.py gate → 13/13 as expected
  • In gaia tui, ask the flagship to run a project's tests: the prompt reads RUNS CODE, shows the command once, and offers a always: pytest; after a, a differently spelled test run doesn't prompt
  • Shift+Tab: status bar shows ⏵⏵ accept edits; a file edit in the project runs unasked while a shell command still asks; the next Shift+Tab explains full access and lands on ask
  • CI re-runs the gaia_resilience and gaia_files eval categories: the agent now sees different wording after an approval prompt expires on a write
🔍 Technical details

Live drive (flagship agent over stdio, Fireworks deepseek-v4p1-flash), same request on a clean main build and on this branch.

Before:

  DESTRUCTIVE  Confirm: run_shell_command

 Run 'run_shell_command' with command="python -m pytest -q tests/",
 working_directory="C:\Users\Kalin\AppData\Local\Temp\claude\C--Users-Kalin-Work-gaia--claude-worktrees-youthful-
 pike-76967f\0b35cb91-efcd-4a06-814b-4b5da6860f61\scratchpad\proj"?

 A shell command can read, change, or delete anything you can — check the command above before approving.

 y run once · n/esc deny · auto-denies in 10 minutes if you do nothing

After (keys are filled keycaps; no red text on the prompt — only the DESTRUCTIVE badge stays red):

  RUNS CODE  Run this command?

 python -m pytest -q tests/

 mode: ask · shift+tab to change · expires in 10 minutes

  y  once ·  a  always: pytest (this session) ·  n/esc  deny
─────────────────────────────────────────────────────────────────────────
  ● agent gaia waiting for your answer        ↑↓/wheel scroll · answer above · Ctrl+C quit

After a, cd <proj> && pytest -q tests/ 2>&1 | tail -5 ran with no prompt (trace: one needs_confirmation across both turns). In accept edits, edit_file + write_file ran unasked and the test run still prompted with mode: accept edits.

Wire changes (all additive): needs_confirmation.risk; tool_decision accepts timeout (stdio and POST …/tool_decision); stdio control verb accept_edits and --accept-edits for respawn. An older agent treats timeout as deny and ignores accept_edits.

Grant safety: a line is granted only when shlex's POSIX (escape on) and Windows (escape off) readings put the operators in the same places, so pytest \" ; curl x ; \" gets no grant. Accept edits resolves file_path/project_dir exactly as file_io_tools._resolve_target (parity test). Agent._policy_refusal still runs before any grant or mode check.

The eval wasn't run: no system prompt, tool schema, or docstring changed. The only model-facing text is the denial reason on a timeout.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Reviewed the timeout-resolves-to-what-permission-state question specifically, since that's the part of this PR with real security weight. Verdict: a timed-out prompt still denies the action — the "timeout" wording only changes what the agent is told, not whether the tool runs.

Two independent enforcement points confirm this:

  • confirm_tool_execution's own wait timeout (hub/agents/gaia/python/gaia_agent/stdio.py) already returned False before this PR; unchanged here.
  • The new explicit timed_out decision path forces it too: self._confirm_result = (approved or always) and not timed_out — so even if a client somehow sent timed_out=True, approved=True, the call is still denied.
  • An unrecognized decision string over the wire is handled the same way: apply_control logs "Fail closed: an unreadable decision is not consent" and coerces it to DECISION_DENY.

That matches the safe default already used elsewhere (e.g. the base agent's confirmation gating) — nothing here loosens it. What changes is purely the message: the agent is now told "the request expired" instead of "the user refused," so it can retry instead of giving up. Same for the retired bypass_permissions control verb — an older/mismatched host sending it still gets answered by turning full access OFF (_RETIRED_CONTROL_VERB handling), the safe direction.

Also checked the two other security-relevant boundaries this PR touches:

  • Accept-edits scope: _shadows_a_program, the .git/ check, and PATH membership are all excluded from auto-accept regardless of mode, with dedicated tests (TestAcceptEditsNeverAutoAcceptsInsideGit, test_a_file_that_would_shadow_a_program_is_never_auto_accepted, etc.).
  • Full access unlock: still gated behind an explicit /full-access confirm the first time Shift+Tab reaches it in a session — never armed by a stray keypress, per the PR's own stated goal.
🔍 Technical details

Conflict/CI status:

  • The only merge conflict was in tui/internal/ui/components/confirmation_test.go — two independent PRs (feat(gaia): add developer-only coding-agent MCP handoffs #3911, already merged, and this one) each appended a new test function at the same anchor point. Purely additive, no logic overlap. Rebased onto current main and pushed (kalin/permission-prompts-4446, now 2d21119c7).
  • go build ./... and go test ./... pass post-rebase; the Python test-plan items (test_tool_grants.py, test_call_risk.py, test_confirmation_summary.py, test_stdio_permission_control.py, test_stdio_wire_contract.py) pass (168/168); util/tui_driver.py gate → 13/13; python util/lint.py --all passes.
  • The rebase surfaced one real (if trivial) lint regression: the new module-level import shutil in src/gaia/agents/base/console.py collided with a pre-existing local import shutil inside _render_ansi_image, which Pylint flags as W0404: Reimport. Fixed by dropping the now-redundant local import (commit 2d21119c7) — confirmed shutil is still reachable via the module-level import at both use sites.
  • Full CI run on the rebased branch: 45+ checks green (build matrix, installers, TUI Build & Test, hub agent test suites, security tests, docs checks). Two failures are pre-existing and unrelated to this diff, not caused by it:
    • Test Agent SDK on Windows (Lemonade Integration) — a live-model test_performance_integration returned an empty response (assertGreater(len(response.text), 0) failed); file is tests/test_agent_sdk.py, untouched by this PR.
    • Unit Tests (Windows smoke) — tests/unit/engineering/test_store.py::test_atomic_concurrent_feedback_preserves_all_updates fails on assert (33206 & 511) == 384, a POSIX file-mode assertion that doesn't hold on Windows; file is unrelated to permission prompts.
    • The Linux and macOS Unit Tests lanes were still queued/running at the time of this comment — worth a final glance before merge, but nothing so far points at this PR's own files.

No open review comments were found on the PR at the time of this review.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Follow-up on the two lanes that were still queued above: macOS Unit Tests smoke finished and failed on the exact same pre-existing case — tests/unit/test_memory_turn_recall.py::TestRelevantMemoriesAreSurfaced::test_the_relevant_note_reaches_the_turn_with_its_age, the known faiss/torch OpenMP double-load abort on macOS (OMP: Error #15), unrelated to this PR's files. It failed identically on the pre-rebase run of this same branch, so this isn't something the rebase introduced.

Linux (py3.12) full unit tests were still running at the time of this comment — worth checking once it lands, but nothing seen so far across 45+ other green checks points at this PR's own code.

kovtcharov and others added 3 commits September 29, 2026 13:42
… reported as timeouts

Permission prompts called running the tests DESTRUCTIVE, printed the command
twice with a wrapped temp path, offered "always" only for file writes, and an
unanswered prompt was reported to the agent as the user saying no.

- The agent reads each call and sends a `risk` (read / write / execute /
  destructive); the prompt is labelled by it. The command is shown once, a
  leading `cd` moves to a short "in ..." line, long commands keep head and tail.
- `a` (always this session) now covers a command family on shell and Python
  prompts: `pytest` covers `python -m pytest` and `cd x && pytest 2>&1 | tail`.
  Deletes, unreadable lines and file redirects get no grant, and a line is only
  granted when the POSIX and Windows readings split it the same way.
- Shift+Tab cycles ask -> accept edits -> full access, shown in the status bar
  and on every prompt. Accept edits lets file edits inside the starting folder
  run unasked (never .git, PATH folders, or a Windows file that shadows a
  program). Full access is only switched on by Shift+Tab once it has been
  confirmed this session or the launch had it. Refused commands stay refused
  in every mode but full access.
- The TUI answers an expired prompt with `timeout`; the agent tells the user it
  timed out instead of that they refused it.
- Status-bar hint budget now measures what the bar paints, so the last hint is
  never clipped.

Docs: terminal-hub guide, CLI reference (full access, TUI flags from amd#3140),
stdio contract spec, and the hub agent's SPEC/SKILL/CHANGELOG.

Closes amd#4446
Red text read as an error on a prompt that is a question, and the answer
keys were drawn in the same dim italic as the footnote, so they were the
easiest thing on the prompt to miss.

- Title is plain bold text; "denied" is dim; the full-access banner uses the
  warning colour. The only red left is the DESTRUCTIVE badge.
- y / a / n/esc are filled keycaps with their labels in body text.
- A blank row separates the title, the command, the warning, the mode line
  and the keys. The keys stay on the last row so a clipped prompt is still
  answerable.
The new module-level shutil import collided with an existing local
import shutil inside _render_ansi_image, which pylint flags as a
reimport.
@kovtcharov
kovtcharov force-pushed the kalin/permission-prompts-4446 branch from 2d21119 to d3eec0e Compare September 29, 2026 20:45
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

The core change is sound. A timed-out prompt still refuses the action. The agent is just told it expired instead of hearing that the user said no. Grants now cover a whole command family, but they still refuse deletes, file redirects, lines GAIA can't parse, and lines that only parse under one of the two shells. The shell tool's own path check still runs on every piped cat/grep, so pairing a read with a granted command can't read files that cat alone would be refused.

🟡 Accept edits trusts whatever folder the session starts in, and that can be the home folder. Launched from ~, the mode would write ~/.bashrc, ~/.profile, ~/.ssh/authorized_keys or GAIA's own config without asking. Those files run code or grant access on their own, which is the same risk this PR already blocks for .git/ and PATH folders. Consider refusing accept edits when the root is the home directory (or a drive root), or excluding dotfiles directly under the root, and add a test for it.

🟢 python -m pytest -c pytest.ini gets the "any inline Python" grant instead of pytest. The label is honest but broader than the user meant, so it's a small surprise rather than a hole.

🔍 Technical details

Accept-edits root: hub/agents/gaia/python/gaia_agent/stdio.py:202 defaults _edit_roots to (os.getcwd(),). edit_is_inside (src/gaia/agents/base/console.py:163) excludes only .git, PATH entries and Windows PATHEXT shadows. With cwd == $HOME, write_file(file_path="~/.bashrc"-resolved) returns True from edit_is_auto_accepted. Possible fix:

home = os.path.realpath(os.path.expanduser("~"))
roots = tuple(r for r in roots if os.path.realpath(r) not in (home, os.path.abspath(os.sep)))

A root-level dotfile exclusion (resolved whose first component under the root starts with .) would also cover .envrc (direnv runs it on cd).

-c mislabel: _family in src/gaia/agents/base/tool_grants.py checks "-c" in argv[1:] before effective_argv, so a pytest -c <inifile> flag is read as python -c. Checking only the tokens before -m would fix it.

Verified OK

  • resolve_tool_confirmation forces (approved or always) and not timed_out, and an unknown stdio decision string is denied.
  • edit_is_auto_accepted runs after auto_approve_confirmations_enabled and before grants. It is only reachable through PermissionState, so the HTTP path can't enable it.
  • _tokenize only accepts a line when the POSIX and Windows readings put the operators in the same places, which closes the \" ; curl trick.

Accept edits trusted whatever folder the session started in. Started from
the home folder, it would have written ~/.bashrc or ~/.ssh/authorized_keys
without asking — files that run code or grant access on their own, the same
risk .git/ and PATH folders were already excluded for.

- A home folder or drive root is never a workspace; nothing is auto-accepted.
- Hidden files and folders inside the workspace still ask (.bashrc, .envrc,
  .github/workflows).
- `python -m pytest -c pytest.ini` is the `pytest` family again: -c after -m
  belongs to pytest, not to python.
kovtcharov and others added 3 commits October 1, 2026 23:21
Python runners keep main's cautious Destructive default and its code-pointing warning for agents too old to send a risk; a current agent's risk still replaces that guess, so test runs still read RUNS CODE. The agent-sent destructive warning from this branch is kept alongside main's command/code split.
# Conflicts:
#	src/gaia/agents/base/tool_grants.py
#	src/gaia/ui/sse_translation.py
grtninja pushed a commit to grtninja/gaia that referenced this pull request Oct 2, 2026
…amd#4542)

Asking the flagship for a region total from a CSV raised a red
**DESTRUCTIVE** prompt that said a read-only pandas `groupby` "may not
be reversible". Six tools the agent gates (`run_python`,
`execute_python_file`, `wait_for_condition`, `install_cli`,
`sign_in_cli` and `notify_desktop`) were missing from the TUI's risk
table, so they fell to the cautious default. A warning that is false on
safe calls teaches people to approve without reading.

Code runners keep the cautious tier but now say what's true: *Python
code can read, change, or delete anything you can — check the code above
before approving.* CLI setup and desktop notifications are Write. A new
test fails whenever a tool in `TOOLS_REQUIRING_CONFIRMATION` has no
tier. It caught `notify_desktop`, which wasn't in the original bug
report.

## Test plan
- [x] `go test ./internal/ui/components/`
- [x] `pytest tests/unit/agents/test_confirmation_required_tools.py`
- [x] Live in the TUI with local Qwen3-30B: "Use run_python to print the
sum of 2 and 2" shows the new wording, and approving it prints `4`.


**Overlap with amd#4461:** that PR moves risk to a per-call `risk` field
from the agent and adds a RUNS CODE tier for the two Python tools, which
is better for those two. This PR is the small fix that ships now. Its
coverage test and the `install_cli`, `sign_in_cli`, `notify_desktop` and
`wait_for_condition` tiers still apply after amd#4461. Whichever merges
second should take amd#4461's `RiskExecute` for the Python tools.
aksh8b pushed a commit to aksh8b/gaia that referenced this pull request Oct 4, 2026
amd#4640)

Five contributor skills under `.claude/skills/` were giving instructions
that stopped matching the repo. They pointed builders and responders at
agents deleted when per-task agents became hub skills, such as "mirror
the `analyst` package" or "link the jira/docker/blender guide". One
cited a `gaia audio` command that doesn't exist. Another said the base
`Agent` never imports Lemonade at module level, when it does. After this
PR, each of those skills names the agents, guides and imports that
actually exist.

The 16 product skills under `hub/skills/` needed no change. Every tool,
command, flag and path they reference checks out, and all 16 pass `gaia
skill audit` with ALLOW. That means nothing the flagship agent reads at
runtime changed, so no eval is needed for this PR.

<details>
<summary>🔍 Technical details</summary>

- `gaia-build-agent`: templates to mirror are now `hello-world` /
`word-count` / `email`, and the closer base class is `ChatAgent`. The
non-default model example is the email agent's NPU pick, not a
summarizer. The eval step now matches CLAUDE.md: there is no committed
baseline yet, so report the measured scores.
- `integrate-hub-agent`: the agent list now matches `hub/agents/`. The
name-divergence example is now real: the flagship's module is
`gaia_agent` and its npm package is `@amd-gaia/gaia`. The entry point
comes from `gaia-agent.yaml` `entry_module`, because the flagship has no
`build_registration()`.
- `github-issue-response`: the "where things live" map lists the agents
and guides that exist today.
- `lemonade-client-patterns`: `agent.py` imports `DEFAULT_MODEL_NAME`,
the ctx helpers and `CONNECTION_FAILURE_RE` at module level. The skill
now describes that accurately instead of forbidding what is already
there. `gaia audio` now reads "audio transcription".
- `weekly-audit-patterns`: the published agents are email and the
flagship. The audit prompt itself is updated in the review-automation
PR.
- How the refs were checked: a script resolved every backticked path,
`gaia <cmd>` subcommand, `--flag`, `gaia.*` module and code symbol in
both skill sets against `git ls-files`, the argparse definitions, and
the `@tool`-registered names. Flags it raised that turned out to be
relative paths or harness tools (`SendUserFile`) were dropped.
`testing-the-gaia-agent` and `adding-eval-scorecard` are left alone
because open PRs amd#4461 and amd#4056 edit them.
</details>

## Test plan

- [x] `pytest tests/unit/test_ai_doc_paths_exist.py
tests/unit/test_no_stale_agent_paths.py
tests/unit/test_starter_skills.py tests/unit/test_skills_format.py
tests/unit/test_skills_drift.py
tests/unit/test_skills_audit_no_false_positives.py
tests/unit/test_skills_audit_instructions.py
tests/unit/test_skill_sets.py tests/unit/test_flagship_ci.py
tests/unit/test_skills_manager.py tests/unit/test_adaptive_skills.py`
(961 passed, 16 skipped)
- [x] `gaia skill audit hub/skills/<each>` returns ALLOW for all 16

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Kalin Ovtcharov added 5 commits October 4, 2026 13:21
# Conflicts:
#	hub/agents/gaia/npm/CHANGELOG.md
The committed openapi.gaia.json still described tool_decision as allow/deny/always, so test_committed_openapi_artifact_is_up_to_date failed once this branch met main's artifact check. The gaia guide listed the same three values.
Kalin Ovtcharov and others added 4 commits October 4, 2026 15:20
# Conflicts:
#	src/gaia/ui/sse_handler.py
…write

A write whose approval prompt nobody answered was recorded as "The write to X
was declined", and the completion check told the model never to retry it. That
contradicted the timeout message the model had just seen (the user did not
refuse; ask whether to try again).

The console now records whether a denial timed out, the denied tool result
carries "timed_out": true, and the completion ledger words it as "wasn't
confirmed in time" with a correction that asks the user instead of retrying.
A real decline keeps the "do not retry" wording.
@kovtcharov
kovtcharov marked this pull request as draft October 5, 2026 04:40
@kovtcharov
kovtcharov marked this pull request as ready for review October 5, 2026 04:40
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Verdict: Request changes

This PR makes permission prompts much better: they label what a command actually does, show it once, offer a scoped "always" for command families, report an unanswered prompt as a timeout rather than a refusal, and add a Shift+Tab "accept edits" mode. The grant logic is careful, and the cases where the two shells read a line differently, deletes, and file redirects all correctly stay ungranted. One thing blocks merge, in the new accept-edits mode.

🔒 SECURITY CONCERN: in accept-edits mode, the "is this edit inside the project folder?" check and the file tools can disagree about where some paths point. So a file edit can run without asking even though it lands outside the folder the user started GAIA in. @kovtcharov-amd — please look before merge. To fix it, make the check resolve paths exactly as the file tools do, and add that case to the existing parity test.

Real-world evidence

N/A: there's no evidence-bundle.md for this run. The PR description includes the author's own before/after TUI drive over stdio, with no screenshot on the PR. Nothing was exercised here, so for the accept-edits path this verdict rests on static review alone.

🔍 Technical details

Issues found

🔴 Accept-edits workspace check doesn't expand ~ (src/gaia/agents/base/console.py:158, edit_target)
edit_target claims parity with file_io_tools._resolve_target, but _resolve_target calls Path(file_path).expanduser() (as _file_path_target does for write_python_file and the others) and edit_target does not. os.path.realpath("~/x/y.py") resolves to <cwd>/~/x/y.py, so edit_is_inside treats it as inside the workspace with no hidden segment and auto-accepts it. The tool then writes to $HOME/x/y.py. Only ~ paths whose first segment is a dotfile are caught by accident. Fix it in edit_target:

    target = os.path.expanduser(path_argument(tool_args))
    if not target:
        return ""
    project_dir = tool_args.get("project_dir") if isinstance(tool_args, dict) else None

Also add {"file_path": "~/a/b.py"} to test_edit_target_matches_the_file_tools_resolution (tests/unit/test_stdio_permission_control.py:668), plus a negative accept-edits test with a ~-rooted target. The parity test passed only because none of its three cases used ~.

🟢 python -Ic "…" is labelled python (any script), not inline Python (src/gaia/agents/base/tool_grants.py, _family)
The -c check only matches a standalone -c token, so combined short flags fall through to the script family. Both scopes are already unbounded, so this only makes the label less precise, not the grant wider. Optional: treat any own flag that starts with - but not -- and contains c as inline.

Strengths

  • command_facts._tokenize grants a line only when the POSIX and Windows lexers agree on where the operators fall. That is a principled answer to the \"-escape split, and it fails closed.
  • Family grants are conjunctive (all(key in grants …)), and DESTRUCTIVE lines and file redirects never produce a scope. A granted pytest therefore can't carry a && rm or | sh along with it.
  • Timeouts are threaded end to end (stdio verb, HTTP /tool_decision, Denial.timed_out, the completion-check wording). An older agent still fails closed, because it treats timeout as deny. The hub SPEC, SKILL, CHANGELOG and OpenAPI are all updated together.

# Conflicts:
#	tests/unit/agents/test_completion_evidence.py
Same block as amd#4460 so the two merge cleanly in either order: a prompt
nobody answered carries the timed-out flag and is not written to the
declined-effects record when that record exists.
The workspace check now expands a home-relative path before deciding, as
write_file and edit_file do, and the parity test covers that case.
Brings in amd#4460. The agent loop now asks the console directly whether a prompt timed out, instead of the duck-typed lookup both PRs carried while either could merge first, so a timeout from the Agent UI or stdio console is never written to the declined-effects record. Tests drive both real consoles through a timeout and a decline.
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 5, 2026
Merged via the queue into amd:main with commit 5644695 Oct 5, 2026
@kovtcharov-amd
kovtcharov-amd deleted the kalin/permission-prompts-4446 branch October 5, 2026 21:32
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Oct 5, 2026
… Windows (amd#4760)

The required `Unit Tests (Windows, py3.12)` job fails intermittently on
PRs that don't touch logging (amd#4461, amd#4734), and it is reporting a real
bug: on Windows `gaia.log` could grow past its cap when two GAIA
processes write to it. The handler measured the room left in bytes but
the incoming record in characters, and on Windows every line ending is
two bytes on disk, so a record that exactly filled the file tipped it
one byte over. Records are now weighed as the bytes that reach the disk,
so the cap holds on every platform. No lines were ever lost, and the
assertion is unchanged.

Text with accented or non-Latin characters under-counted the same way on
macOS and Linux; that is fixed by the same change.

## Test plan

- [x] `python -m pytest tests/unit/test_log_rotation.py
tests/unit/test_logger_home_unresolvable.py
tests/unit/test_logger_stdio_redirect.py` passes on macOS, three runs in
a row.
- [x] With only the old character count restored, the new tests fail
with the CI signature: every line present, one file at cap + 1
(`{'gaia.log.13': 351, ...}` at a 350-byte cap), using two real
processes with the rename refused and CRLF on disk.
- [ ] `Unit Tests (Windows, py3.12)` passes on this PR. This is the
first run of the fix on a real Windows machine; the Windows behaviour
was emulated locally.

<details>
<summary>🔍 Technical details</summary>

- Cause: `emit` checked `size + len(msg) > max_bytes`, with `size` from
`os.path.getsize` and `msg` a `str` written through a text-mode stream.
The over-cap write needs `size + len(msg) == max_bytes` exactly. With
the test's lines that sum is unreachable for one writer or two in step,
and reachable once one process is about 50 lines ahead of the other,
which is why only the two-process test failed and only sometimes. A
model of the check puts it at roughly 1 run in 20.
- Fix: `SharedRotatingFileHandler` encodes the record first (`_encode`,
applying `_LINESEP`), checks `_fits`, and writes those bytes through an
`"ab"` handle. Line endings on disk are unchanged: CRLF on Windows, LF
elsewhere.
- The lock-timeout path (`_write_unlocked`) used `size >= max_bytes`,
which allowed a full record of overshoot. It now uses the same check.
- Contract, now stated in the module docstring and pinned by a test: no
file exceeds the cap, except a single record larger than the whole cap,
which is written alone to an empty file rather than dropped.
- Ruled out: the copy + truncate fallback, stale handles, and the lock.
The failing run kept all 1,600 lines, and a second handler whose handle
predates another writer's copy + truncate appends at the new end of file
(`test_windows_line_endings_count_toward_the_cap`).
- `daemon.log` / `lemonade.log` are not affected. `rotate_if_oversized`
compares one byte size with the cap at start and renames; there is no
per-record accounting.
</details>

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
kovtcharov-amd added a commit that referenced this pull request Oct 5, 2026
… double

PR #4461 added AgentConsole.confirmation_timed_out() and a call site in
_execute_tool, but this file's two _SlowHuman test consoles predate it and
don't implement the method, so Agent._execute_tool's getattr/callable check
raises AttributeError on current main.
@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 documentation Documentation changes tests Test changes tui Go terminal UI (gaia-tui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tui): permission prompts over-alarm, repeat themselves, and hide the way to trust a session

2 participants