Skip to content

feat(tools): gh tools default to the configured repo when repo is omitted#12

Merged
mabry1985 merged 2 commits into
mainfrom
feat/tools-default-repo
Jun 26, 2026
Merged

feat(tools): gh tools default to the configured repo when repo is omitted#12
mabry1985 merged 2 commits into
mainfrom
feat/tools-default-repo

Conversation

@mabry1985

Copy link
Copy Markdown
Contributor

Why

Every read/write tool required an explicit owner/name repo — so an agent with a single configured repo had to repeat it on every call, and (as the operator saw) Ava would stop to ask "which repo do you want me to check?" even though github.default_repo was set.

Change

repo is now optional on all read + write tools and falls back to the configured default:

explicit repogithub.default_repo → first of github.reposGITHUB_DEFAULT_REPO/GH_REPO env → error.

(Same resolution resolve_repo already powered for /issue and the board, so the tools, the command, and the board all agree.) An explicit repo still wins. With no repo and no default, the error now points at Settings ▸ GitHub instead of claiming there's no default.

The default is read from config at register time; tools are rebuilt on a config reload, so it tracks edits without a restart.

repo moved after any required param (e.g. github_get_pr(number, repo="")) so it can carry a default — arg order is cosmetic for a LangChain @tool (the model calls by name).

Tests

  • omit repo → uses the configured default; explicit repo → overrides it; no repo + no default + no env → clear error
  • existing invalid-repo tests updated to the new message
  • ruff clean; full suite 87 passed.

…mitted

Every read/write tool required an explicit `owner/name` repo, so an agent with one
repo had to repeat it (and Ava would ask "which repo?"). `repo` is now optional on
all tools and falls back to the configured default — `github.default_repo`, else the
first of `github.repos` (the same resolution as /issue and the board), then the
GITHUB_DEFAULT_REPO / GH_REPO env. An explicit `repo` still wins; with no repo and no
default, the error now points at Settings ▸ GitHub instead of claiming there's no
default. Tools rebuild on a config reload, so the default tracks edits.

`repo` moved after any required param (e.g. `github_get_pr(number, repo="")`) so it can
carry a default — arg order is cosmetic for @tool (the LLM calls by name).
@protoquinn

protoquinn Bot commented Jun 26, 2026

Copy link
Copy Markdown

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Audit — PR #12 | feat(tools): gh tools default to the configured repo when repo is omitted

VERDICT: WARN (non-terminal CI — test still running; will finalize on re-dispatch)


CI Status

  • test: in_progress

Diff Review

  • All read tools now accept an optional repo falling back to the configured default via resolve_repo() — the same resolution chain /issue and the board already use, so all plugin surfaces agree.
  • repo arg moved after required params (number, ref, run_id, path) in each @tool signature; cosmetic for LangChain (the model calls by name) and the PR description explains this clearly.
  • __init__.py computes default_repo once at register time using effective_default_repo() and threads it into both get_read_tools() and get_write_tools(). Config reload rebuilds tools, so it tracks edits without a restart.
  • bad_repo() error message updated to point users at Settings ▸ GitHub instead of claiming there's no default — good UX improvement.

Observations

  • LOW: clawpatch structural review unavailable (502 — checkout cache failed on main ref). Diff-based review did not surface blocking issues.
  • NOTE: diff truncated at 485 lines — write_tools.py changes are presumed consistent with read_tools.py pattern but not directly reviewed. The __init__.py change passes default_repo to both, and author reports 87 passing tests covering both paths.
  • The resolution chain (explicit → default_repo → first of repos → env → error) is identical to the existing /issue path — no new resolution logic introduced, just reuse of a tested code path.

No blocking findings from the diff. Awaiting terminal CI for formal verdict.

— Quinn, QA Engineer

@protoquinn

protoquinn Bot commented Jun 26, 2026

Copy link
Copy Markdown

Submitted COMMENT review on #12 — non-blocking while CI completes. The CI-completion event will re-dispatch me for the formal PASS/FAIL.

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI terminal-green, no blockers on prior review — auto-approving on green (#748).

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Audit — PR #12 | feat(tools): gh tools default to the configured repo when repo is omitted

VERDICT: WARN (CI in progress — non-blocking comment)


CI Status

  • test: in_progress

Diff Review

  • All read + write tools now accept optional repo with fallback via resolve_repo — clean consistent pattern across read_tools.py and write_tools.py
  • default_repo computed once at register time from effective_default_repo(cfg) and threaded into get_read_tools / get_write_tools — correct lifecycle (tools rebuilt on config reload)
  • bad_repo error message improved to point at Settings ▸ GitHub instead of claiming no default exists
  • Arg order: repo moved after required params (e.g. number before repo) — cosmetic for @tool, model calls by name
  • Import of effective_default_repo lifted to module level in __init__.py, deduplicating the /issue command block

Observations

  • LOW: clawpatch structural review unavailable (checkout cache SHA resolution error on main) — diff is straightforward, resolution path is resolve_repo which is already production-tested via /issue and board
  • No unresolved CodeRabbit threads

— Quinn, QA Engineer

@protoquinn

protoquinn Bot commented Jun 26, 2026

Copy link
Copy Markdown

Submitted COMMENT review on #12.

@mabry1985 mabry1985 merged commit df27974 into main Jun 26, 2026
1 check passed
@mabry1985 mabry1985 deleted the feat/tools-default-repo branch June 26, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant