The function only checked for string-form type inside anyOf/oneOf variants,
missing the array form (e.g., type: ["array", "null"]). This mirrors the
handling already done at the top-level property schema.
Remove core dependency from webui by inlining followup controller logic.
This fixes nightly release CI failure where npm version couldn't resolve
the core peer dependency for prerelease versions.
- Move FollowupState type and INITIAL_FOLLOWUP_STATE to src/types/followup.ts
- Inline createFollowupController into src/hooks/useFollowupSuggestions.ts
- Remove separate @qwen-code/webui/followup subpath and vite config
- Export useFollowupSuggestions from main entry
Fixes#2900
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
The vsce package was causing ESM module resolution errors when building
locally due to a dependency cycle between ansi-regex (ESM-only in v6)
and strip-ansi (CommonJS) pulled in by @textlint/linter-formatter.
CI already installs vsce globally before packaging, so this change
aligns local builds with CI behavior. Developers should install vsce
globally: npm install -g @vscode/vsce
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Previously: fetch → create worktree → incremental check → "no changes"
→ delete worktree (wasted time creating it).
Now: fetch → incremental check (via git rev-parse on fetched ref) →
if no changes, delete ref and stop (no worktree ever created).
Worktree only created when review will actually proceed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The broad CODEOWNERS wildcard was adding notification noise without
providing meaningful ownership boundaries. Removing it so that any
team member with write access can provide approving reviews.
1. Step 9 --comment guard blocked "post comments" follow-up path.
Fixed: allow entry via either --comment flag OR follow-up request.
2. Cross-repo gh pr review needs -R {owner}/{repo}. Added note.
3. "post comments" tip shown even when --comment already set (double
posting risk). Fixed: tip only shown when --comment NOT specified.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LLM ignored the "do not submit summary for Comment verdict" rule
despite it being written. Restructured: warning emoji + STOP instruction
first, then the exception cases. The default is "don't post", not
"decide whether to post."
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Root cause: LLM was calling gh pr review for each inline comment
instead of using gh api for comments and gh pr review once for the
verdict. Added explicit "Two-phase posting" instruction: complete ALL
inline comments (gh api) first, THEN submit verdict (gh pr review)
ONCE. Do NOT call gh pr review per comment.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Commands were hardcoded as ./mvnw and ./gradlew despite text saying
"prefer wrapper if exists, else mvn/gradle". Changed to explicit
conditional: "use ./mvnw if it exists, otherwise mvn" with {mvn}
placeholder in examples. Applied to Step 3 and Agent 5.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two rejected alternatives added from real debugging:
1. Verbose agent prompts → exceed output token budget → serial fallback
2. Relaxed "try 3+2" instruction → model always takes the fallback
Key constraint: each agent prompt ≤200 words for all 5 to fit in
one response and launch in parallel.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each agent prompt must be under 200 words. With 5 verbose prompts,
the total output exceeds the model's output token limit, forcing
serial execution. Shorter prompts = all 5 fit in one response =
parallel execution.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cross-repo lightweight mode has no local codebase — Agent 5 (build/test)
is pointless. Now launches 4 agents instead of 5 in cross-repo mode.
Updated token count tables in SKILL.md, user doc, and DESIGN.md:
same-repo = 7 LLM calls, cross-repo = 6.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The relaxed "if you cannot fit 5, try 3+2" gave the model a fallback
that it always took (serial execution). Restored strict requirement:
MUST include all 5 tool calls in one response. The runtime confirms
concurrent agent execution is supported.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(core): implement mid-turn queue drain for agent execution
Inject queued user messages between tool execution steps within a single
turn, so the model sees them immediately instead of waiting for the
entire round to complete.
- Add `dequeueAll()` to AsyncMessageQueue
- Add `midTurnDrain` callback to ReasoningLoopOptions
- Drain queue after processFunctionCalls, inject as text parts
- AgentComposer always enqueues directly (no local buffering)
- Add QUEUE_MESSAGES_CONSUMED event for UI sync
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(cli): add mid-turn queue drain to main session
Extend mid-turn queue drain to the main session's tool execution path
(useGeminiStream). Previously only agent tabs had this feature.
- Add midTurnDrainRef parameter to useGeminiStream
- Inject queued messages in handleCompletedTools before submitQuery
- Bridge useMessageQueue to drain ref in AppContainer via ref pattern
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address Copilot review feedback on mid-turn drain
- Guard midTurnDrain with abort check to prevent message loss on cancel
- Synchronously clear messageQueueRef to prevent duplicate drains
- Only clear pending display on IDLE status, not all status changes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: scope mid-turn drain to main session only
Revert subagent-path changes (AgentCore, AgentInteractive,
AgentComposer, AsyncMessageQueue, agent-events) to keep the PR
focused on the main session, which is easier to test and validate.
Subagent mid-turn drain can be added in a follow-up PR.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address Copilot review on main session mid-turn drain
- Move synchronous queue ref into useMessageQueue itself, expose
drainQueue() for atomic drain (fixes race between addMessage and drain)
- Record drained messages as USER history items so the transcript
stays complete
- Simplify AppContainer bridge to just midTurnDrainRef.current = drainQueue
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: guard mid-turn drain against cancelled turns
- Skip drain when turnCancelledRef or abortController signal is set,
so queued messages stay for the next turn instead of being lost
- Restore ref-based queue bridge (drainQueue removed from useMessageQueue)
- Keep synchronous ref clear to prevent duplicate drains
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The strict "all 5 in one response" requirement may exceed the model's
output token limit. Changed to: prefer all 5 in one response, but
allow splitting (e.g., 3+2) as long as agents launch without waiting
for previous ones to finish. Runtime confirms parallel execution is
supported (coreToolScheduler tests).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. When verdict is Comment and SOME inline comments fail, submit
a summary with the failed findings (not lost). Only skip summary
when ALL inline comments succeed.
2. Accept *italic* for model attribution in prose — prettier
normalizes _italic_ to *italic* in markdown, both render the same.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Many repos rely on wrappers and don't require global Maven/Gradle
installed. Now prefers ./mvnw over mvn and ./gradlew over gradle
in both Step 3 (linter) and Agent 5 (build/test).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Step 11: conditional worktree removal — skip if Step 8 flagged
preservation (autofix commit/push failure)
2. Standardize model attribution to _italic_ (was mixed *italic*)
3. Cache stores pre-autofix headRefOid (not worktree HEAD which may
include the autofix commit)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously, rule 7 (CI config auto-discovery) only ran for "unrecognized
projects." Java/Makefile (e.g., OpenJDK) and C/C++/Makefile matched
earlier rules that said "skip," so CI config was never read.
Now: language-specific rules 1-6 run first for known tools, then rule 7
runs for ALL projects to discover additional CI-defined checks. OpenJDK
will now discover jcheck and custom targets from .github/workflows/*.yml.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Step 9 code block: annotate Comment template applies only when
no inline comments were posted (avoids LLM confusion)
2. Step 11: fix stale rationale — Step 9 uses API calls, not worktree
3. Verdict: explicitly based on high-confidence findings only —
low-confidence findings don't influence PR approval status
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When verdict is "Comment" and inline comments were posted successfully,
do NOT submit an additional gh pr review — the inline comments are
sufficient. Only submit summary for Approve/Request changes (which
carry approval status) or when no inline comments were posted.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Each inline PR comment now includes model attribution footer
(e.g., "— qwen3-coder") so reviewers know which model produced
each comment.
2. When inline comments are posted successfully, the review summary
is minimal (verdict + model only, no repeated findings). Full
summary is only used when no inline comments were posted.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- User doc: added "Other" row to language table + explanation that
CI config is read for unrecognized projects
- DESIGN.md: added "Why auto-discover from CI config" decision
section + added .qwen/review-tools.md to rejected alternatives
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
For projects that don't match standard tool patterns (e.g., OpenJDK),
Step 3 and Agent 5 now read CI configuration files (.github/workflows,
.gitlab-ci.yml, Jenkinsfile, Makefile) to discover what lint/build/test
commands the project uses. No user configuration needed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Pure integer PR numbers default to origin (no URL-based remote
matching available). URL-based PRs use the matched remote.
2. Autofix push uses matched remote instead of hardcoded origin.
Push failure is expected for fork PRs where user lacks push
access — handled gracefully with informative message.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Cross-repo lightweight mode: no longer skips Step 11 entirely.
Worktree removal is skipped (none created) but temp files are
still cleaned up.
2. Step 2 base-branch fetch: use the matched remote from Step 1
(e.g., upstream for forks) instead of hardcoded origin.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously compared URL owner/repo against gh repo view (current repo
only). This caused fork-based workflows to be wrongly classified as
cross-repo (e.g., local clone of wenshao/jdk reviewing openjdk/jdk PR).
Now checks all git remotes (git remote -v) for a match. If any remote
points to the URL's repo, proceeds with full worktree mode using that
remote for fetch. Only falls back to lightweight mode if NO remote
matches.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Step 9 hardcoded gh repo view to get owner/repo, which returns the
current repo — wrong for cross-repo reviews. Now explicitly branches:
same-repo uses gh repo view, cross-repo uses URL-extracted owner/repo.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- git branch -D: add 2>/dev/null || true to both cleanup sites
(Step 1 stale cleanup + Step 11) to prevent abort if ref missing
- Cross-repo doc: clarify Agents 1-4 only (Agent 5 build/test
requires local codebase, not available in cross-repo mode)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Line 22: "Step 2" → "Step 4" (agents are Step 4, rules are Step 2)
2. PR section: clarify "same-repo URL" to avoid ambiguity with
cross-repo lightweight path
3. Cross-file analysis: add "same-repo only" qualifier (no local
files in cross-repo mode for grep_search)
4. Cross-repo lightweight mode: add existing PR comment fetching
to avoid duplicating human feedback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Strengthen the parallel instruction from "five parallel review agents"
to explicitly requiring all 5 task tool calls in one response. Without
this, the LLM may serialize agents (wait for each to finish), losing
the wall-clock time benefit of parallel execution.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SKILL.md:
- Step 9 must use owner/repo from URL (not gh repo view) for cross-repo
- Step 2 (project rules) skipped in cross-repo mode (no local files)
User doc: add Cross-repo PR Review section with same-repo vs cross-repo
capability comparison table.
DESIGN.md: add "Why cross-repo uses lightweight mode" section explaining
CLI tools are inherently repo-local and our approach is best available.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of rejecting cross-repo PR URLs, run in lightweight mode:
use gh pr diff <url> to get diff directly (no worktree needed),
skip deterministic analysis and build/test, and review diff text
only with LLM agents.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a PR URL points to a different repo (e.g., other-org/other-repo),
the review would silently operate on the wrong PR in the current repo.
Now verifies URL owner/repo matches current repo before proceeding.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
If autofix pushes a new commit in Step 3.5, the PR HEAD changes.
Step 4's inline comments would then reference the autofix commit
where line numbers may have shifted, causing comments on wrong lines.
Fix: capture headRefOid in Step 1 (before autofix) and reuse in
Step 4. Also fix stale Step 5 comment about worktree/commit SHA.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reverse audit agent already has full context (all confirmed findings +
entire diff), so its findings don't need a second opinion. This brings
the actual LLM call count to 7 (5 review + 1 verify + 1 reverse),
matching the documented claim.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
If a previous review was interrupted (Ctrl+C, crash), stale worktree
and local ref would block the next review. Now Step 1 checks for and
cleans up stale .qwen/tmp/review-pr-<N> worktree and qwen-review/pr-<N>
ref before creating new ones.
Step 5 also cleans up the local ref alongside the worktree.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mermaid only renders on GitHub; shows as raw code on Nextra,
Docusaurus, VS Code preview, and offline viewing. Plain-text
ASCII diagram is universally compatible and includes LLM call
cost annotations on each stage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>