fix(cli): propagate --repo/--path to search/chat subparsers, fix --ba…#1671
fix(cli): propagate --repo/--path to search/chat subparsers, fix --ba…#1671somo9909 wants to merge 3 commits into
Conversation
…se-url help text (amd#1078)
SummaryThis PR aims to fix #1078 by letting The I reproduced this against the actual PR parser (
Only the last row — the case the PR description verified — actually works. Issues Found🔴 Critical — subparser
|
|
🔴
repo_path = os.path.abspath(args.repo) # TypeError: expected str, not NoneEvery existing usage example in the help text ( Fix: guard the Alternatively, remove |
|
🟡
Quick fix before |
|
🟡 The three inline comments ( Two smaller issues also introduced by this push:
|
- Prevents subparser default=None clobbering parent default='.' - Makes --path a true alias for --repo via dest='repo' Fixes amd#1078
c1a4083 to
abd0579
Compare
|
🟡 try:
from gaia.ui.agent_loop import agent_loop
agent_loop.notify_user_message(request.session_id)
except Exception: # pylint: disable=broad-except
passThis is new code in |
|
🔴 Lines 22–32, 60–89, 112–116, and 123–130 contain raw The |
kovtcharov-amd
left a comment
There was a problem hiding this comment.
Thanks for tackling #1078, @somo9909 — the core argparse fix is exactly right. Using default=argparse.SUPPRESS on the subparser --repo/--path so the parent's default="." survives, and aliasing --path to dest="repo", is the clean way to do this. 👍
There are a couple of blocking issues to clear before this can merge, though:
1. Unresolved merge-conflict markers committed (blocking). hub/agents/python/email/gaia_agent_email/tools/profile_tools.py contains 12 raw conflict markers (<<<<<<< HEAD / ======= / >>>>>>> upstream/main). Some land inside the ProfileToolsMixin class body, so the module won't import (SyntaxError). Looks like a merge got committed mid-resolution. Please git merge upstream/main, resolve cleanly, and recommit.
2. Out-of-scope changes. This PR is fix(cli): propagate --repo/--path, but it also edits docs/guides/email.mdx (email-preferences persistence wording) and profile_tools.py (email agent). Those belong to the email-agent work, not this CLI fix. Please drop them so the PR is scoped to the gaia_agent_code CLI change only.
3. Minor nits in hub/agents/python/code/gaia_agent_code/cli.py:
- Trailing whitespace on the
type=str,line (util/lint.py --allwill flag it). - Missing final newline after
sys.exit(main()).
Once the conflict markers are gone and the diff is scoped to the CLI fix, this is good to go. The --base-url default correction to http://localhost:13305/api/v1 is a nice catch too.
Fixes #1078
Changes
--repotosearchsubparser--repoand--pathtochatsubparser--base-urlhelp text to show correct default (http://localhost:13305/api/v1)Testing
Verified with direct parser tests:
gaia-code index search "query" --repo .gaia-code index chat --repo .gaia-code index chat --path .