4 Commits

Author SHA1 Message Date
Markus Hofstetter
81edd958f9 fix: diff generation for PR checkouts
actions/checkout for PRs only fetches refs/pull/N/head into FETCH_HEAD.
Remote tracking branches (origin/main) don't exist.

Fix: explicit refspec fetch (refs/heads/main:refs/remotes/origin/main)
with fallback to GITEA_BASE_REF / GITHUB_BASE_REF for the target branch.
Also removed --filter=blob:none which could cause empty diffs.
Added diagnostic logging for base ref and file stats.
2026-05-19 00:47:01 +02:00
Markus Hofstetter
bb34a3f2ec fix: debug mode now extracts tool calls from Pi session file
Pi doesn't log tool calls to stderr in print mode. Instead, we save
the session (.jsonl) and parse it to extract every tool_use entry
showing which files were read, grep patterns used, etc.
2026-05-18 23:51:36 +02:00
Markus Hofstetter
3654e36a7b feat: add debug mode to capture agent tool log
When debug: true, the review comment includes a collapsible section
showing which files the agent read, grep patterns used, etc.
Also prints agent log on failure for easier troubleshooting.
2026-05-18 23:14:51 +02:00
Markus Hofstetter
28b4b23550 feat: initial pi-review Docker action
Reusable Gitea/GitHub action that runs Pi coding agent for
AI-powered code reviews on pull requests.

- Docker image based on node:24-slim (112 packages)
- Supports built-in providers (zai, anthropic, openai, deepseek, openrouter)
  and custom OpenAI-compatible endpoints
- Generates git diff (excludes lockfiles/generated code by default)
- Posts review as idempotent PR comment (updates existing on re-run)
- Read-only tools only: agent investigates but never modifies code
- 80KB default diff truncation to stay within LLM context windows
- No curl/python3 dependency — uses Node.js for HTTP and JSON
2026-05-18 22:09:46 +02:00