Commit graph

809 commits

Author SHA1 Message Date
Jason Cat
27def8684b
fix(scan): resolve --path like the filesystem and reject nonexistent paths (#1709)
Some checks are pending
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
plugin-contract / plugin-contract (push) Waiting to run
* fix(scan): match --path selectors case-insensitively

On Windows and macOS a --path selector such as SRC names an existing directory (the filesystem resolves it), but filterByPaths compared selectors to git ls-files output byte-for-byte, so the scan silently selected no files and exited 0. Fold case like the other user-facing path filters (--include/--exclude, secret paths, the extension allowlist).

Refs #1708

* fix(scan): prefer the exact --path spelling before folding case

A selector now matches its own spelling first, so on a case-sensitive
filesystem --path src cannot widen to a sibling SRC/; case-insensitive
matching stays as a per-selector fallback, the repair for --path SRC on
Windows and macOS. Documented on the ocr scan page in all locales.

* fix(scan): resolve --path against the filesystem before folding case

A selector's own spelling is tried first; a spelling that names nothing
must resolve in the working tree before case folding applies, so on a
case-sensitive filesystem a wrongly-cased --path is an error instead of
a folded match or a silent empty scan. Docs updated in all locales.

* fix(scan): resolve --path selectors to their on-disk path

A selector that names nothing in its own spelling is resolved against
the working tree -- symlinks followed, on-disk case taken where the
filesystem folds it -- and only the resolved path is matched, replacing
the case-fold fallback. An empty src/docs/ therefore selects nothing on
a case-sensitive filesystem even while src/DOCS/ holds tracked files.

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-19 17:13:29 +08:00
Tao Xin
6d68b1aacb
feat(language): support for Nushell language (#956)
* docs: nushell.md from @hustcer

* feat: file extensions

* chore: add new nu (NU) extensions

* Credits for `nushell.md`

Co-authored-by: hustcer <hustcer@outlook.com>

* docs: update supported languages

* fixup: CI failures from bad merge

* chore: fix merge

* credits for nushell.md

* docs: sync nushell into korean site docs

* chore: append excludsion to indexes

* chore: format with prettier [skip ci]

---------

Co-authored-by: hustcer <hustcer@outlook.com>
Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-19 15:45:22 +08:00
xie well
46790d9e87
feat(rules): add PowerShell review support (#970)
* feat(rules): add PowerShell review support

* docs(rules): sync PowerShell translations

* fix(rules): refine PowerShell guidance and regression tests

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-19 14:58:16 +08:00
超級の新人
0ac5b402c8
docs(contributing): update directory structure and descriptions across multiple languages (#1729)
- Enhanced the contributing documentation by adding new sections for `acp`, `docs`, `imgs`, `chatgptauth`, `delegate`, `llmloop`, `mcp`, `scan`, and `scripts`.
- Improved clarity in existing sections, particularly in `cmd/opencodereview/`, emphasizing the role of command dispatch.
- Ensured consistency in terminology and descriptions across English, Japanese, Korean, Russian, and Chinese versions of the documentation.

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-19 13:58:55 +08:00
jack
ca1065a298
docs(contributing): refresh Project Structure and add chatgptauth (#1721)
Keep the CONTRIBUTING Project Structure trees in sync with main,
including internal/chatgptauth from #1622 (review feedback on #1721).

Co-authored-by: Frank-zhu2000 <332350688+Frank-zhu2000@users.noreply.github.com>
Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-19 11:05:18 +08:00
Matteo Redaelli
9867a3d163
terraform: adding .tofu extension used by opentofu (#1464)
* terraform: adding .tofu extension (used by opentofu projects)

* table align in md files

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-19 10:28:57 +08:00
Tao Xin
8eb83340a4
fix(config): fix bad config for providers or keys that cotains dots (self-defined) (#1661)
Some checks failed
plugin-contract / plugin-contract (push) Has been cancelled
CI / test (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / cross-compile (amd64, darwin) (push) Has been cancelled
CI / cross-compile (amd64, windows) (push) Has been cancelled
CI / cross-compile (arm64, darwin) (push) Has been cancelled
CI / cross-compile (arm64, linux) (push) Has been cancelled
CI / cross-compile (arm64, windows) (push) Has been cancelled
CodeQL Advanced / Analyze (go) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
* main fix

* chore: write tests (AI)

* fix(config): validate dotted provider names across CLI and IDEs

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-16 11:17:26 +08:00
Ziyang Guo
11ac6d4c57
fix(scan): surface llmloop token-budget stop on the run-level state (#1745)
Some checks are pending
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
* fix(scan): surface llmloop token-budget stop on the run-level state

`#1248` (merged 2026-09-17) added an in-conversation token-budget stop to
`internal/llmloop.RunMainTask` and wired its `StopTokenBudget` outcome
through to the review path's run-level `budgetExceeded` flag plus a
`token_budget_reached` warning (see `internal/agent/agent.go` near
`executeGroupSubtask`).

The scan path was left out: `internal/scan.Agent.budgetExceeded` is
still set only by the dispatchBatch look-ahead check, and
`executeSubtask` does not react to a `StopTokenBudget` returned by
`llmloop.RunMainTask`. The result is that an in-flight token-budget
stop fired mid-task on a scan run leaves:

- `cmd/opencodereview` `--format json` `budget_exceeded: false` even
  though the run stopped on the budget, and the stderr
  `budget_exceeded=...` line lying for the same reason;
- no `token_budget_reached` warning, so `ocr session list` and the
  other warnings-driven surfaces can't distinguish a budget stop from
  other failure modes.

This change mirrors the review path: in `executeSubtask`, on a
non-completed stop with `stop == llmloop.StopTokenBudget`, atomically
flip `budgetExceeded` via `CompareAndSwap` and emit one
`token_budget_reached` warning. `budgetExceeded` is now
`atomic.Bool` (was plain `bool`) for the same reason the review
agent uses one.

Fixes the gap between the two commands' `BudgetExceeded()` /
`token_budget_reached` reporting. The per-item failure record keeps
existing semantics: the inner `main_task did not complete before
stopping: <Reason>` string still feeds the `scan_subtask_error`
warning unchanged, so the diagnostic that survives `--format json`
continues to name the stop trigger via `llmloop.StopTokenBudget.Reason()`.

* docs: Apply batched suggestions from code review

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-15 19:22:28 +08:00
Kite
ea5ced22ea
fix(frontend): update vulnerable development dependencies (#1751) 2026-10-15 10:59:12 +08:00
Jason Cat
81df1f6b1f
fix(llmloop): count a grace-round task_done as completion (#1678)
* fix(llmloop): count a grace-round task_done as completion

The grace round after an exhausted budget offers only code_comment and
task_done, and asks the model to call task_done when it has nothing further
to report. That checkpoint was discarded and RunMainTask returned
completed=false, so a file the model had finished was recorded as
incomplete: scan wrote review_item_failed instead of a reusable
review_item_done, and a later resume re-ran it.

Report grace-round completion and return it. Stops that never run a grace
round, and a task_done(FAILED), are unchanged.

closes #1018

* fix(llmloop): warn when a review limit reaches the grace round

A task that spends its tool-request rounds or token budget and then
completes in the grace round reported success with no trace of the
limit, so a zero-finding result could read as clean. Record a
review_limit_reached warning with the stop reason and the round's
verdict, and qualify the zero-finding message in text and JSON output.
Completion, the reusable checkpoint, and budget_exceeded are unchanged.

* fix(llmloop): let failure veto grace-round completion

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-10-15 10:52:27 +08:00
Kite
d73c9d3329
fix(vscode): update vulnerable development dependencies (#1746)
Some checks are pending
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
2026-10-14 15:39:19 +08:00
PARVEZ MOSHARAF
b842659ed9
chore(deps): bump google.golang.org/grpc to v1.83.2 (#1205)
Some checks failed
CI / windows (push) Has been cancelled
plugin-contract / plugin-contract (push) Has been cancelled
Action Contract / action-contract (push) Has been cancelled
CI / test (push) Has been cancelled
CI / cross-compile (amd64, darwin) (push) Has been cancelled
CI / cross-compile (amd64, windows) (push) Has been cancelled
CI / cross-compile (arm64, darwin) (push) Has been cancelled
CI / cross-compile (arm64, linux) (push) Has been cancelled
CI / cross-compile (arm64, windows) (push) Has been cancelled
CodeQL Advanced / Analyze (go) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
* chore(deps): bump google.golang.org/grpc

Bumps the go_modules group with 1 update in the / directory: [google.golang.org/grpc](https://github.com/grpc/grpc-go).


Updates `google.golang.org/grpc` from 1.83.0 to 1.83.1
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.83.0...v1.83.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.83.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump google.golang.org/grpc

Bumps the go_modules group with 1 update in the / directory: [google.golang.org/grpc](https://github.com/grpc/grpc-go).


Updates `google.golang.org/grpc` from 1.83.1 to 1.83.2
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.83.1...v1.83.2)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.83.2
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>

* Ok

* chore(deps): bump the npm_and_yarn group across 2 directories with 2 updates

Bumps the npm_and_yarn group with 1 update in the /extensions/vscode directory: [markdown-it](https://github.com/markdown-it/markdown-it).
Bumps the npm_and_yarn group with 1 update in the /plugins/open-code-review/opencode directory: [ip-address](https://github.com/beaugunderson/ip-address).


Updates `markdown-it` from 14.2.0 to 14.3.2
- [Changelog](https://github.com/markdown-it/markdown-it/blob/14.3.2/CHANGELOG.md)
- [Commits](https://github.com/markdown-it/markdown-it/compare/14.2.0...14.3.2)

Updates `ip-address` from 10.7.0 to 10.7.3
- [Release notes](https://github.com/beaugunderson/ip-address/releases)
- [Commits](https://github.com/beaugunderson/ip-address/compare/v10.7.0...v10.7.3)

---
updated-dependencies:
- dependency-name: markdown-it
  dependency-version: 14.3.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: ip-address
  dependency-version: 10.7.3
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: limit dependency PR to grpc update

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-10-13 21:47:09 +08:00
Kite
1672852136
ci(release): publish to npm via trusted publishing (#1732)
* ci(release): publish to npm via trusted publishing

Replace the NPM_TOKEN secret with GitHub OIDC token exchange, and add a
manually triggered job that verifies every package's trusted publisher
configuration without publishing anything.

npm only accepts an OIDC exchange from a cloud-hosted runner, so those two
jobs run on ubuntu-latest while the Go build matrix stays on self-hosted.

* fix(ci): harden npm trusted publishing checks

* fix(test): encode all slashes in release contract URLs
2026-10-13 17:45:38 +08:00
祈愿Qiii
3694a716c3
fix: follow up ChatGPT auth recovery and provider credentials (#1622) (#1718)
* Fix ChatGPT auth recovery and provider credential handling

* Handle rejected refresh identities and review feedback

* docs: explain ChatGPT recovery and gateway credentials

* Fix refresh window after pending token recovery

---------

Co-authored-by: Qiyuanqiii <267806965+Qiyuanqiii@users.noreply.github.com>
2026-10-13 12:47:24 +08:00
Andrew C. Oliver
c7734212e1
feat(auth): enable ChatGPT plan reviews through public Responses (#1622)
* feat(auth): enable ChatGPT plan reviews through public Responses

* fix(auth): prevent stale credential status and provider keys

* Fix ChatGPT auth tests on Windows

---------

Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-10-13 10:21:19 +08:00
Rui
4a3844c42f
fix(scan): record rendered prompt overflow as a failed review (#1652)
Some checks failed
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
plugin-contract / plugin-contract (push) Waiting to run
ACP CI / test (push) Has been cancelled
* fix(scan): record rendered prompt overflow as a failed review

Fixes alibaba/open-code-review#1650

* fix(scan): preserve reused checkpoints when new tasks fail

Signed-off-by: Rui <1685901819@qq.com>

---------

Signed-off-by: Rui <1685901819@qq.com>
2026-10-12 19:41:07 +08:00
超級の新人
e96c79d4d6
feat(acp): support ACP service for OpenCodeReview (#1218)
Add an independent stdio ACP adapter with slash commands, optional
natural-language parsing, managed review/scan processes, CI, and
multilingual setup docs. Keep the OCR CLI source and prompts unchanged.

* refactor(acp): add ACP adapter and supporting services
* ci(acp): use patched Go toolchain
* docs(acp): trim support caveats and sync CI notes

  Drop dated verification claims and the prebuilt-binary disclaimer so the
  adapter docs match the current local-build story and acp-ci.yml.

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-12 12:52:29 +08:00
Trainingcqy
64654f834e
fix(agent): make deleted files readable through file_read_diff (#1698)
Some checks are pending
CI / cross-compile (arm64, windows) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-12 11:53:06 +08:00
Trainingcqy
f32dace4dc
fix(agent): list deleted files under their own path in the change list (#1680)
Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-12 10:59:11 +08:00
OUAO-FRANK
357c3f09a2
fix(opencode): preserve OCR output on Windows (#1606)
Some checks failed
CI / cross-compile (amd64, darwin) (push) Has been cancelled
CI / cross-compile (arm64, darwin) (push) Has been cancelled
CI / cross-compile (arm64, linux) (push) Has been cancelled
CI / test (push) Has been cancelled
CI / cross-compile (amd64, windows) (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / cross-compile (arm64, windows) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
plugin-contract / plugin-contract (push) Has been cancelled
CodeQL Advanced / Analyze (go) (push) Has been cancelled
Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-10 16:37:26 +08:00
九日
35fc3e259d
test(allowlist): catch an extension disappearing from the allowlist (#1626)
Some checks failed
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
plugin-contract / plugin-contract (push) Waiting to run
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
Co-authored-by: gu-feng418 <287555569+gu-feng418@users.noreply.github.com>
Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-10 08:55:20 +08:00
祈愿Qiii
25af21ce37
docs(delegate): prevent pager hangs; ci: upgrade Go and x/net (#1062)
* docs(delegate): disable git pagers in agent environments

* docs(delegate): streamline pager guidance

* docs(delegate): clarify pager terminology

* docs(delegate): harden diff retrieval across integrations

* fix(ci): refresh Go toolchains and simplify delegate docs

* fix(delegate): complete pager and path coverage

* fix(ci): restore patched Go dependencies

* docs(delegate): simplify review instructions

* test(delegate): reject empty command examples

---------

Co-authored-by: Qiyuanqiii <267806965+Qiyuanqiii@users.noreply.github.com>
2026-10-10 08:40:12 +08:00
BASIL K AJI
fabbdb296b
fix(scan): treat "." as the repository root and convert separators first (#1598)
Some checks failed
CI / test (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / cross-compile (amd64, windows) (push) Has been cancelled
CI / cross-compile (arm64, darwin) (push) Has been cancelled
CI / cross-compile (arm64, linux) (push) Has been cancelled
CI / cross-compile (arm64, windows) (push) Has been cancelled
CodeQL Advanced / Analyze (go) (push) Has been cancelled
CI / cross-compile (amd64, darwin) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
plugin-contract / plugin-contract (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
`ocr scan --path .` selected no files and exited 0. `git ls-files` prints
repository-relative names such as `main.go`, and filterByPaths matches an
exact path or a `<selector>/` prefix, so a selector left as "." matched
nothing. `--path ./` normalized to the same dead selector. Both spellings now
mean the whole repository, which is what an omitted --path already means.

filepath.ToSlash also ran after the "./" trim. On Windows a selector like
`.\internal\scan` only becomes `./internal/scan` during that conversion, so
the prefix survived the trim and matched nothing there either. ToSlash now
runs first, and the "./" trim repeats so `././` collapses.

A root selector alongside a narrower one widens the scan, since the root
already covers it.

closes #1596
closes #1597
2026-10-08 19:42:53 +08:00
Kite
f971ccd362
fix(readme): use a proxy-friendly DeepWiki badge (#1673) 2026-10-08 19:38:26 +08:00
nolanchic
2d67596c96
fix(llm): clarify independent timeouts and deadline diagnostics (#1159)
* fix(llm): let --timeout raise the per-request HTTP deadline

The --timeout flag documents a concurrent-task timeout in minutes, but
the per-request HTTP deadline stayed at the client's independent
5-minute default. A review of one slow file therefore failed with
classification=timeout at duration_to_headers_ms≈300000 even when the
caller granted --timeout 30, and no CLI setting could let the file
review finish (issue #1155).

ResolveOptions gains a TaskTimeout field: when no env
(OCR_LLM_TIMEOUT) or config-file (timeout_sec) request timeout is set,
the task budget raises the request deadline so a single request can use
the whole task budget. Existing precedence is unchanged — env and
config-file timeouts still win, and leaving --timeout at its default
keeps the 5-minute client default.

ocr review and ocr scan both pass their --timeout value through.

Fixes #1155

* fix(cmd): feed the concurrent task timeout into the request deadline

main replaced the per-file timeout flag with --timeout binding
concurrentTaskTimeout, and the agent applies it as a context deadline
across review rounds — but the per-request HTTP deadline stayed at the
client's independent 5-minute default, so a single slow file request
could still die inside a task that had plenty of budget left (#1155's
original symptom).

Wire ResolveOptions.TaskTimeout from the live
opts.concurrentTaskTimeout (minutes) in both review and scan commands.
Precedence is unchanged: env OCR_LLM_TIMEOUT and config-file
timeout_sec still win, and an unset task timeout keeps the 5-minute
client default.

* fix(llm): keep request and task timeouts independent

* docs: localize timeout configuration guidance

* fix(llm): avoid attributing caller deadlines to task timeout

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-10-08 15:06:38 +08:00
Dante
182898cf52
fix(llm): allow unlisted OpenRouter model overrides (#1610)
Some checks failed
CI / test (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / cross-compile (amd64, darwin) (push) Has been cancelled
CI / cross-compile (amd64, windows) (push) Has been cancelled
CI / cross-compile (arm64, darwin) (push) Has been cancelled
CI / cross-compile (arm64, linux) (push) Has been cancelled
CI / cross-compile (arm64, windows) (push) Has been cancelled
CodeQL Advanced / Analyze (go) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
plugin-contract / plugin-contract (push) Has been cancelled
* fix(llm): allow unlisted OpenRouter model overrides

* docs(llm): clarify OpenRouter model overrides

* fix(llm): allow unlisted model overrides for built-in providers

* fix(llm): share stderr test helper across platforms

---------

Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-10-05 14:34:14 +08:00
dvd233
a758d9cbfb
feat(allowlist): add Jinja template support (#1056)
Some checks failed
plugin-contract / plugin-contract (push) Has been cancelled
CI / test (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / cross-compile (amd64, darwin) (push) Has been cancelled
CI / cross-compile (amd64, windows) (push) Has been cancelled
CI / cross-compile (arm64, darwin) (push) Has been cancelled
CI / cross-compile (arm64, linux) (push) Has been cancelled
CI / cross-compile (arm64, windows) (push) Has been cancelled
CodeQL Advanced / Analyze (go) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
* feat(allowlist): add Jinja template support

* docs: shorten Jinja rule descriptions

Co-authored-by: Tao Xin <149216116+wu21-web@users.noreply.github.com>

* refactor(allowlist): group Jinja entries with templates

Co-authored-by: Tao Xin <149216116+wu21-web@users.noreply.github.com>

* fix(config): preserve upstream rules after Jinja conflict resolution

---------

Co-authored-by: Tao Xin <149216116+wu21-web@users.noreply.github.com>
Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-09-29 17:08:37 +08:00
kevin
01af4468c6
fix(idea): list merge commit files against the first parent (#1544)
* fix(idea): list merge commit files against the first parent

* test(idea): skip the merge commit listing when git is not on PATH

The test drives a real git binary. The CI runner's test JVM has none on
its PATH, so ProcessBuilder failed before the first command ran.
2026-09-29 14:40:51 +08:00
Joseph Clauson
998604bcb8
fix(make): append .exe to the dev binary on Windows (#1573)
* fix(make): append .exe to the dev binary on Windows

make build on Windows wrote dist/opencodereview without an extension, which cmd and PowerShell cannot launch. Build, run, and help now use a .exe extension when OS is Windows_NT.

* docs: name the Windows .exe output of make build
2026-09-29 14:35:43 +08:00
祈愿Qiii
f93ff155dd
fix(extensions): generate provider catalogs from Go registry (#1212)
* fix(frontend): generate provider presets from Go registry

* fix(frontend): regenerate provider presets after main sync

* fix(ci): compare provider presets with Go registry

* fix(gen): generate Kotlin names and reject duplicate models

* docs: tighten provider generation guidance

* docs: keep provider generation instructions in AGENTS.md

* docs: Apply batched suggestions from code review

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>

* fix(gen): validate generated import and package declarations

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
Co-authored-by: Qiyuanqiii <267806965+Qiyuanqiii@users.noreply.github.com>
2026-09-29 11:46:45 +08:00
DiegoCluv7
ebb69835a3
fix(viewer): restore Files Reviewed pagination by guarding hidden rows (#1576)
Some checks are pending
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
plugin-contract / plugin-contract (push) Waiting to run
The pager hides rows via the hidden attribute, but .file-list li's
author display: flex outranks the UA [hidden] rule, so every page's
rows stayed visible. Add a .file-list li[hidden] guard like the pager
controls already have for .pagination[hidden], and extend the guard
test to cover row-level [hidden] rules.

Fixes #1575
2026-09-28 17:09:10 +08:00
Ayush Dubey
579b931915
fix(llmloop): account for tool_calls and arguments in messageTokens (#1413)
Assistant turns issuing tool calls under OpenAI-compatible chat completions store their calls and arguments on ToolCalls rather than Native.Payload. Because messageTokens only inspected ExtractText() and Native.EstimatedTokens(), these turns evaluated to 0 tokens during active zone budget calculations, causing computeActiveZoneSize to pack too many rounds and risk exceeding model context limits.

Adds EstimatedTokens to ToolCall (including arguments and ExtraContent) and Message, and updates messageTokens to account for tool calls when not already covered by Native payload.
2026-09-28 15:16:11 +08:00
ydflow
1af527d7ee
docs(cli-reference): list the manifest status values in the status field (#1587)
* docs(cli-reference): list the manifest status values in the status field

The status field table listed only success / completed_with_warnings /
completed_with_errors / skipped. Those four are the pre-manifest path;
every review run that produced a manifest reports the manifest's terminal
state instead (complete / partial / failed / skipped), so the documented
enum was missing the values an actual run emits. Document both paths and
note that skipped also covers the no-supported-files case. Synced across
all five locales.

* docs: Apply batched suggestions from code review

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>

---------

Co-authored-by: ydflow <314143294+ydflow@users.noreply.github.com>
Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-09-28 13:24:16 +08:00
Jimmyman1465
486022daaf
fix(llm): trim environment-sourced endpoint values (#1414)
Some checks failed
CI / test (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / cross-compile (amd64, darwin) (push) Has been cancelled
CI / cross-compile (amd64, windows) (push) Has been cancelled
CI / cross-compile (arm64, darwin) (push) Has been cancelled
CI / cross-compile (arm64, linux) (push) Has been cancelled
CI / cross-compile (arm64, windows) (push) Has been cancelled
CodeQL Advanced / Analyze (go) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
* fix(llm): trim environment-sourced endpoint values

A trailing CR in an environment value — a .env file or a shell wrapper written
with CRLF line endings is the usual source — reached url.Parse and the auth
header verbatim, so one stray CR failed every file of a review with an opaque
error that named neither the environment nor the variable.

Trimming in finalizeResolvedEndpoint instead is not enough: tryCCEnv calls
ensureMessagesSuffix, which appends "/v1/messages" and buries the CR in the
middle of the URL where a later TrimSpace can no longer reach it.

Closes #1395

* Improve LLM endpoint diagnostics
2026-09-24 17:59:47 +08:00
MANAS RASTOGI
7dcaab2db4
feat(llm): exercise a tool-call round trip in ocr llm test (#1394)
A single request never covers the turn after a tool call, so a provider that
rejects that turn passed the connectivity test while failing every review.

Refs #1357

Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-09-24 17:39:03 +08:00
Zihan Zhou
d19649be4e
fix(tool): keep non-ASCII paths literal in file_find results (#1530)
Pass -c core.quotepath=false to git ls-files and git ls-tree, matching code_search and diff, so file_find reports paths that match queries and can be opened by file_read.
2026-09-24 16:51:35 +08:00
祈愿Qiii
5eeebb856b
fix(opencode): handle long background context (#1010)
Some checks failed
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
plugin-contract / plugin-contract (push) Has been cancelled
Deploy Pages / build (push) Has been cancelled
Deploy Pages / deploy (push) Has been cancelled
* fix(opencode): handle long background context

* fix(opencode): address review feedback

* fix(opencode): ignore whitespace-only background

* test(opencode): cover trimmed background input

---------

Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-09-24 15:06:33 +08:00
gadri-07
a290633d68
feat(llm): add OpenRouter to list of providers (#1522)
* feat(llm): add OpenRouter as a built-in provider

* feat: Apply suggestion from @lizhengfeng101

* test: drop openrouter_test.go

OpenRouter is a standard ProtocolOpenAIChatCompletions entry — no new
protocol, no special auth, no new code path.  Every previous provider
addition in the same category (gemini, xAI, kimi-global, siliconflow,
novita) only touched providers_test.go, which this PR already does.

TestResolveEndpoint_OpenRouter re-tests generic resolver logic already
covered by resolver_test.go.  TestOpenRouter_ToolCallingRequest re-tests
the OpenAI chat completions client already covered by client_test.go.
The TestLookupProvider_OpenRouterDetails + sorted-list update in
providers_test.go is sufficient.

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-09-24 14:14:50 +08:00
Kite
0243a38c79
docs(readme): replace Go weekly badge with all-language weekly badge (#1559) 2026-09-24 10:52:46 +08:00
ydflow
5e1ed498d6
docs(review-rules): document merge_system_rule in all five locales (#1555)
* docs(review-rules): document merge_system_rule in all five locales

merge_system_rule has existed on a rule.json entry for a while, but the
review rules guide never mentioned it. The only place it appeared was
skills/open-code-review/SKILL.md, which most users never read. The cost
is real: #1132 asked for exactly this capability as a new feature,
because the docs give every indication that a catch-all user rule
unavoidably discards the per-language system rules.

The field list now carries it alongside path and rule, with the default
stated. A worked example shows the JSON and the resulting
`ocr rules check` output so the System-Specific / User-Specific halves
are visible, and the two edge cases from mergeWithSystemRule are called
out: either half may be empty, and the other is not replaced by a
placeholder.

The system half is resolved per file, so one catch-all entry yields
java.md for .java and python.md for .py. That is the property that makes
the field worth documenting, and it is the one a reader would otherwise
assume away.

Also states the limitation: merging reaches the system layer only. Two
user entries matching the same file still resolve first-match-wins, and
a matching layer still shadows the ones below it.

A recipe covers the common case, since "global security rules on top of
the built-in per-language rules" is what people search for.

Docs only, in en, zh, ja, ru and ko. The translated pages are exempt
from the English-only scan by extension.

* docs(review-rules): address review feedback on merge_system_rule pages

- en: fix the grammar in the per-file resolution bullet and state that
  the global rule file is the lowest of the three user layers, so a
  matching --rule or project entry shadows it
- zh/ja/ko/ru: carry the same layer-priority caveat into each recipe
- ja: fix the 置き換えます typo and reword two sentences that were
  literal translations of the English

---------

Co-authored-by: ydflow <314143294+ydflow@users.noreply.github.com>
2026-09-24 10:21:21 +08:00
BASIL K AJI
dc2beb56fa
feat(session): add 'ocr session rm' to delete a saved session (#1490)
Some checks failed
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
plugin-contract / plugin-contract (push) Waiting to run
Action Contract / action-contract (push) Has been cancelled
Sessions accumulate in ~/.opencodereview/sessions/ with no way to remove one
short of deleting files by hand. The Viewer stays read-only by design, so
deletion belongs in the CLI, where the caller already owns the files.

The session id is enough on its own: the command looks for it under every
repository, so it works from anywhere. That a session is stored under a
directory derived from its repository is an implementation detail, and making
the caller stand in the right repository to delete by id pushes that detail
onto them. --repo narrows the search rather than enabling it.

An id saved for more than one repository lists the candidates and deletes
nothing. encodeRepoPath replaces separators with "-", so two repository paths
can share one sessions directory and one id can name two different files;
choosing between them would be a coin flip on a file that cannot be recovered.

The command prints the session's repository, branch, start time, file count
and comment count in the same format `ocr session list` uses, then asks to
confirm. A non-interactive stdin answers no, so `--yes` has to be passed
deliberately from a pipeline or CI.

Reports an unreadable session rather than folding it into "corrupt" -- a
session whose metadata cannot be parsed is still deletable, since that is the
record most likely to need removing. Documented in all five locales of the CLI
reference.

Co-authored-by: Qiyuanqiii <267806965+Qiyuanqiii@users.noreply.github.com>
Co-authored-by: wu21-web <wu2196674@icloud.com>
2026-09-23 20:14:06 +08:00
祈愿Qiii
5f8e5ab328
fix(action): allow checkpoints after out-of-diff findings (#1524)
* fix(action): allow checkpoints after out-of-diff findings

* fix(action): keep malformed locations checkpoint-blocking

---------

Co-authored-by: Qiyuanqiii <267806965+Qiyuanqiii@users.noreply.github.com>
2026-09-23 11:50:04 +08:00
衡洋洋
6fdfb91af0
fix(config): remove OCR_CONFIG_PATH (#1537)
Some checks are pending
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
2026-09-23 11:19:21 +08:00
MANAS RASTOGI
0a5fe167a8
fix(llm): replay tool_call extra_content and surface provider error bodies (#1393)
* fix(llm): replay tool_call extra_content and surface provider error bodies

Gemini 3 on OpenAI-compatible endpoints requires the thought signature in
tool_calls[].extra_content to be echoed back unchanged, and array-wrapped
error documents were dropped before reaching the user.

Fixes #1357
Fixes #1042

* feat: Apply suggestion from @lizhengfeng101

* fix(session): keep llm_request tool-call field order stable

Project tool calls through an ordered struct instead of a map, so records
without extra_content stay byte-identical to the previous format.

* fix(llm): drop invalid UTF-8 from surfaced error bodies

A character split by the 64 KiB display cap became a replacement
character, which the source also carried as a literal.

Co-authored-by: Tao Xin <wu2196674@icloud.com>

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
Co-authored-by: Tao Xin <wu2196674@icloud.com>
2026-09-23 10:07:19 +08:00
Kite
bccbc15f78
docs(agents): add guideline to comment sparingly and explain why (#1534)
Some checks are pending
CI / test (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
plugin-contract / plugin-contract (push) Waiting to run
* docs(agents): add guideline to comment sparingly and explain why

* feat: Update AGENTS.md

Co-authored-by: Tao Xin <wu2196674@icloud.com>

---------

Co-authored-by: Tao Xin <wu2196674@icloud.com>
2026-09-22 18:54:32 +08:00
Kamakhya Singh
e333b0be4b
security: validate credential commands and expand .gitattributes binary markers (#1291)
* security: validate credential commands and warn on plaintext secrets

- Add validateKeyCmd() in internal/llm/keycmd.go to reject suspicious
  shell patterns (command separators, backticks, redirections) in
  api_key_cmd and auth_token_cmd before the shell executes them.
  Provides a clear diagnostic for tampered or accidentally malformed
  config rather than silently running destructive expressions.

- Add plaintext credential warnings in internal/llm/resolver.go when
  api_key or auth_token are stored as static strings in the config
  file. Credential is still accepted; the warning nudges users toward
  api_key_cmd / auth_token_cmd so secrets are not at rest in JSON.

- Extend .gitattributes with explicit binary markers for web fonts
  (woff, woff2, ttf, otf, eot), WebAssembly (.wasm), compressed
  archives (.zip, .tar, .gz, .tgz), and other image formats (.webp,
  .bmp, .tiff) to prevent CRLF corruption on Windows clones.

* fix(keycmd): tighten validateKeyCmd per review feedback

Three bugs flagged by the code review bot:

- Backtick regex was backtick-space, missing the common case of`cmd`
  with no space. Changed to match any backtick character.

- Command-separator [;|&] and redirection \d*>>?\s*\S were too broad:
  they rejected existing tests that use semicolons, ampersands, and
  2>/dev/null, which are legitimate in helpers that suppress stderr
  or chain commands. Both patterns are removed; only backtick and
  null byte checks remain, each with zero plausible false-positives.

- Custom min() shadowed Go built-in min (Go 1.21+). go.mod declares
  go 1.25.5, so removed the custom helper and inlined the bounds check.

* security: gate plaintext credential warnings and add tests

Address review feedback on the credential-hardening change:

- Emit the plaintext api_key / auth_token warning only when no
  corresponding api_key_cmd / auth_token_cmd is configured. This removes
  the duplicate warning when both a static key and a command were set,
  and limits the nudge to configs that actually lack a secret-manager
  path. The legacy check now also runs after the completeness guard so
  an incomplete llm block no longer warns spuriously.
- Trim the oversized suspiciousPatterns / validateKeyCmd comments to the
  essentials.
- Add tests: validateKeyCmd backtick / NUL rejection (unit and through
  resolveKeyCmd), and the plaintext-warning fire / suppress paths for
  both the provider and legacy config.

* Revert plaintext-credential warning from #1291

The nudge printed a stderr WARNING on every run for the common,
supported case of a static api_key/auth_token in config, producing
unsuppressable noise with no functional benefit and risking CI stderr
assertions. Restore silent acceptance of static credentials; the
both-set warning and the keycmd backtick/NUL validation are unchanged.

---------

Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-09-22 18:45:34 +08:00
Lyutingyu
2e4896bb94
fix(session): preserve findings across file renames (#1529)
Some checks are pending
Action Contract / action-contract (push) Waiting to run
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
plugin-contract / plugin-contract (push) Waiting to run
2026-09-22 15:56:35 +08:00
Maddog2050
3f8d63d8c5
Fix/gitlab multiline comments and suggestions (#1000)
* fix(examples): Fix GitLab CI discussions so they highlight all the lines

* fix(examples): Fix GitLab CI suggestions so they show all the lines of the before state

* Fix(examples): Move sha1 computation and add start_line to loop

* fix(exampes): line_range is now only added fro multiline comments

* fix(examples): Added multiline check to suggestions

* fix(examples): resolve GitLab multiline line_code from the MR diff

A multiline discussion's line_code hardcoded old_line=0
(<sha>_0_<new>), which is only valid for purely-added lines; GitLab
rejects it when a boundary falls on an unchanged context line. Resolve
each boundary from the MR diff: added lines keep <sha>_0_<new>, context
lines use their real old line, and line_range is omitted (single-line
anchor) when the diff or a boundary cannot be resolved.

---------

Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
2026-09-22 13:33:07 +08:00
dvd233
6d17aa4cdc
fix(config): preserve unknown JSON fields during config updates (#1508)
* fix(config): preserve unknown JSON fields

* fix(config): derive JSON field names from tags

* feat: Apply suggestion from @lizhengfeng101

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-09-22 13:24:30 +08:00
kevin
64e0e1533a
fix(review): keep git stderr out of --commit background (#1467) 2026-09-22 12:57:38 +08:00