Skip to content

Feature UI#7

Merged
qchapp merged 9 commits into
developfrom
feature-ui
Oct 22, 2025
Merged

Feature UI#7
qchapp merged 9 commits into
developfrom
feature-ui

Conversation

@qchapp
Copy link
Copy Markdown
Member

@qchapp qchapp commented Oct 22, 2025

This pull request updates the agent's pipeline to enforce stricter repository verification for tool candidates and improves error handling and usage limits. The main changes include requiring GitHub repository verification before returning tool candidates, updating the repo_info tool to validate and handle only GitHub URLs, increasing tool call limits, and clarifying the agent's prompt instructions.

Repository verification and tool selection process:

  • The agent's prompt instructions now require that, before returning any tool candidates, each must be verified with a repo_info(url) call using a valid GitHub repository URL or owner/repo. Candidates lacking such a URL are dropped. Only verified candidates are returned, and demo links are resolved after verification.

repo_info tool improvements:

  • The repo_info tool now validates input URLs, accepting only GitHub URLs or owner/repo strings. If an invalid URL is provided, it returns a structured error and skips the call. Error handling is improved for fetch failures, and the call cap is increased from 2 to 3 per run.
  • The tool import in agent.py is updated to use tool_repo_summary, RepoSummaryInput, and coerce_github_url_or_none for the new validation logic.

Agent execution and configuration:

  • The agent's total allowed tool calls per run is increased from 6 to 10, aligning with the stricter verification requirements.
  • A GITHUB_TOKEN environment variable is added to .env.dist for authenticated GitHub API access.

@qchapp qchapp requested a review from Copilot October 22, 2025 16:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the agent's tool verification process by requiring GitHub repository validation before returning tool candidates, and improves the repository information tool with better URL handling and error reporting.

Key changes:

  • Agent must now call repo_info(url) to verify each tool candidate's GitHub repository before returning it in the final output
  • The repo_info tool is rewritten to validate GitHub URLs, fetch comprehensive repository summaries via the GitHub REST API, and return structured errors for invalid inputs
  • Tool call limits increased from 6 to 10 per run to accommodate the stricter verification workflow

Reviewed Changes

Copilot reviewed 7 out of 37 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/test_repo_summary.py New test script for the rewritten repo_info tool
src/ai_agent/utils/previews.py Enhanced RGB/color image detection to prevent treating color TIFFs as 3D stacks
src/ai_agent/ui/app.py Added interactive radio selection handler for tool choices with live detail updates
src/ai_agent/generator/prompts.py Updated agent instructions to mandate repo_info verification before returning candidates
src/ai_agent/agent/tools/repo_info_tool.py Complete rewrite: validates GitHub URLs, fetches repo snapshots via GitHub API, builds structured Markdown summaries
src/ai_agent/agent/agent.py Updated to use new tool_repo_summary function with URL validation and increased call limits
.env.dist Added GITHUB_TOKEN for authenticated GitHub API access

Comment thread tests/test_repo_summary.py Outdated
Comment thread tests/test_repo_summary.py Outdated
Comment thread src/ai_agent/agent/tools/repo_info_tool.py Outdated
continue
for m in INSTALL_PAT.finditer(f.content):
out.append((m.group(0).strip(), f.path))
return _dedupe_pairs(out)[:3] # <-- changed
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The inline comment # <-- changed appears to be a development artifact and should be removed before merging.

Copilot uses AI. Check for mistakes.
for m in CLI_LINE_RE.finditer(f.content):
cmd = re.sub(r"^\s*(\$|>)\s*", "", m.group(0)).strip()
out.append((cmd, f.path))
return _dedupe_pairs(out)[:5] # <-- changed
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The inline comment # <-- changed appears to be a development artifact and should be removed before merging.

Copilot uses AI. Check for mistakes.
Comment thread src/ai_agent/agent/tools/repo_info_tool.py Outdated
qchapp and others added 5 commits October 22, 2025 19:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@qchapp qchapp merged commit 17148e6 into develop Oct 22, 2025
2 checks passed
@qchapp qchapp deleted the feature-ui branch October 22, 2025 17:02
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.

2 participants