Skip to content

fix(project-context): follow-ups to the folder trust prompt - #6987

Merged
kovtcharov-amd merged 1 commit into
amd:mainfrom
akshat-lakhera:fix/6289-trust-followups
Nov 9, 2026
Merged

kovtcharov-amd merged 1 commit into
amd:mainfrom
akshat-lakhera:fix/6289-trust-followups

Conversation

@akshat-lakhera

Copy link
Copy Markdown
Contributor

Summary

This picks up the review notes left on #6965 once the trust prompt went in, covering the project map guide, the Agent UI narration and the duplicated prompt check.

Why

The project map guide still said a Claude model gets the repository's guidance under auto without mentioning that the folder has to be trusted first, and it never explained what happens when a trusted folder's files change later, while the Agent UI kept saying "Reading this folder's instructions and skills" even though it was only asking the question, and the check for whether anyone is there to answer a prompt was written twice, once for path access and once for the trust prompt, so the two could easily drift apart.

Linked issue

Refs #6289

Changes

The guide now says that auto only loads a folder's guidance once you trust it and that the answer is saved under the folder's path rather than its contents, so a pull that adds or changes a CLAUDE.md, an AGENTS.md or a skill doesn't bring a new question while a moved folder or a second clone gets asked again. The Agent UI narration now reads "Asking to trust this folder" to match the TUI, and the duplicated check has become a single someone_can_answer helper in console.py that both path access and the trust prompt call, behaving exactly as before and with tests on each caller so they stay in sync. The Arabic strings are left as they are and still need a native speaker to look at them.

Test plan

I ran pytest on test_project_trust, test_sse_narration, test_path_access_prompt and test_console_tool_confirmation along with python util/lint.py --all, and everything touched by this change passes.

Evidence

There are no screenshots since the only visible change is the narration text, which test_sse_narration checks directly.

PTAL @kovtcharov-amd

@github-actions github-actions Bot added documentation Documentation changes tests Test changes agents labels Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve

This is a clean follow-up to the folder trust prompt. The Agent UI now says it is asking to trust a folder instead of claiming to read its files, the guide explains that a trusted folder stays trusted when its files change, and the two copies of the "can anyone answer this prompt?" check are now one shared function. The merged check behaves exactly like both old copies, and the new tests pin each caller to it. I found no blocking issues.

Real-world evidence

N/A: no evidence bundle was produced for this run. The only visible change is one line of Agent UI narration text, which a unit test checks directly. This verdict rests on reading the code. I could not run the tests here because the runner has no Python test environment.

🔍 Technical details

Issues found

🟢 Agent UI and TUI word the narration slightly differently when a folder is given (src/gaia/ui/event_narration.py:172). The override plus the generic argument suffix gives Asking to trust this folder: /w/repo, while the TUI (tui/internal/ui/chat/narrate.go:119) shows Asking to trust /w/repo. Without a folder, both read the same. This is optional to fix: no user is misled, but the PR's stated aim was to match the TUI.

Checks run

  • Behaviour equivalence: someone_can_answer (console.py:240) returns the inverse of the old inline path-access check in agent.py, branch for branch (background → no, nobody_answers → no, blocking_confirmation → yes, otherwise a terminal console on an interactive terminal). It is identical to the old _can_ask_about_project body. The pre-approval short-circuit correctly stays in project_map.py.
  • Imports and patch targets: agent.py no longer refers to TerminalConfirmationMixin or terminal_is_interactive, so dropping those imports is safe. No test or hub package still patches gaia.agents.base.agent.terminal_is_interactive, and the one test that did now targets gaia.agents.base.console, which is where the shared function looks the name up.
  • New doc claims vs code: "saved under the folder's path, with links resolved" matches folder_key (realpath + normcase). "A trusted folder loads new files from its next session on" matches _project_trust_cache, which is read once per session. "A subfolder uses the repository's answer" matches resolve_project_root, which walks up to the nearest repository. "A moved folder or a second clone is a new path" follows from the same key.
  • Doc drift: the old narration string Reading this folder's instructions and skills no longer appears anywhere in docs/, hub/, the webui sources or the TUI. Narration strings have no Arabic catalog entry, before or after this change, so this PR adds no new untranslated string.

Strengths

  • The new tests check each caller (path access and folder trust) against the same set of console states, so the two can't drift apart silently again. That was the point of the refactor.
  • The guide now covers the git pull case, which is the one most users will wonder about, and states it accurately.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 9, 2026
Merged via the queue into amd:main with commit b0d1de1 Nov 9, 2026
60 of 62 checks passed
@kovtcharov-amd kovtcharov-amd mentioned this pull request Nov 17, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants