Repository navigation
feat: ask CodeBoarding for the pull request's review guide (experimental) - #160
Conversation
…tal) When `review_guide_url` is set, a review run packs what it already has (both analyses, both call graphs from the static_analysis.pkl beside them, the diff between the two analysed commits, and the changed files at both) into a gzipped bundle, posts it to the closed-functions service, and stores the answer in the review artifact as review_guide.json, where the platform reads it. It authenticates the way the hosted proxy does (a fresh OIDC token plus the license, minted by oidc_relay), or with the run's GITHUB_TOKEN when the workflow cannot mint one; a run with its own Ollama, OpenRouter or OpenAI key sends that key along. Off by default, and it never fails the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeBoarding reviewStatus: 1 changed component See the full change in CodeBoarding. graph LR
n_action_support_scripts["action_support_scripts"]
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
class n_action_support_scripts modified;
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e64b7c858a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| p = checkout / f["filename"] | ||
| try: | ||
| files[f"{head_sha}:{f['filename']}"] = p.read_text(encoding="utf-8") |
There was a problem hiding this comment.
Avoid following checkout symlinks when collecting changed files
When a trusted collaborator requests a review of a fork PR with review_guide_url enabled, the PR can introduce a symlink pointing outside the checkout. read_text() follows that link, so a file pointing to /proc/self/environ on a Linux runner copies this step's environment—including GITHUB_TOKEN, provider keys and OIDC request credentials—into the bundle sent to the guide service. I reproduced the external-file read with a symlink and a secret marker. Read the committed blob or reject symlinks and paths resolving outside the checkout before collecting contents.
Useful? React with 👍 / 👎.
| for name, provider in OWN_KEYS: | ||
| if env.get(name, "").strip(): | ||
| # The service still checks the caller is this repository's run. | ||
| return {**_bearer(env), "x-llm-api-key": env[name].strip(), "x-llm-provider": provider} | ||
| return _bearer(env) |
There was a problem hiding this comment.
Respect the explicitly selected provider for review guides
For a valid workflow selecting llm: anthropic (or another provider outside OWN_KEYS), enabling the guide silently switches its model requests to CodeBoarding's hosted tier: the new action step forwards only three providers' keys, and this fallback returns authentication without any provider selection. This consumes hosted usage and sends code to a different model provider despite the workflow's explicit choice. AGENTS.md requires that a workflow naming a provider “runs on that provider or fails.” Pass the resolved provider plan through and skip the optional guide with an explicit notice when that provider is unsupported, rather than falling back.
AGENTS.md reference: AGENTS.md:L53-L58
Useful? React with 👍 / 👎.
Amp-Thread-ID: https://ampcode.com/threads/T-01a19283-b0bb-7031-833d-a7e3c8c2d0b8 Co-authored-by: Amp <amp@ampcode.com>
What
An experimental step that asks CodeBoarding for the pull request's review guide and stores it in the review artifact. It uses the deployed production service by default; set
review_guide_urlto an empty string to disable it.After the review analysis,
scripts/review_guide.py:analysis.jsonfiles;static_analysis.pklbeside each, so nothing is recomputed;review_guide.json, before the upload. The webview reads it from there (webview #255). The webview never calls the service.Credentials follow the analysis:
oidc_relay.py, the same bearer the hosted proxy gets. The run'sGITHUB_TOKENstands in when the workflow can't mint one.Never fails the run: a refusal, a timeout or a bundle over the service's limit leaves the artifact without a guide and logs one line.
The guide's code isn't in this repository; only the bundling is.
Not done yet
v1yet: the production URL is now the default. Merge and publish an Action release to deliver it tov1users.Changes nothing visible by itself. Tests: 7 new (
tests/test_review_guide.py), all passing with the existing suite; Black clean.🤖 Generated with Claude Code