Repository navigation
fix(web-shell): surface loop detection turn errors #8853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
59c5ccb
fix(web-shell): surface loop detection turn errors
c004d55
fix(cli): expect loop-detected turn error in invalid-params stop test…
54cfa0f
Merge branch 'main' into fix/web-shell-loop-detection-error
qwen-code-dev-bot 0fe2ef9
fix(cli): reject loop-detected stops only for foreground ACP turns
qwen-code-dev-bot 1d32541
fix(acp-bridge): harden loop-detected turn errors per review feedback
qwen-code-dev-bot e4e2ed2
Merge remote-tracking branch 'origin/main' into fix/web-shell-loop-de…
qwen-code-dev-bot 4960ac1
Merge remote-tracking branch 'origin/main' into fix/web-shell-loop-de…
qwen-code-dev-bot 3a338ce
fix(cli): keep channel-prompt turns graceful on loop-detected stops
qwen-code-dev-bot c862d3f
fix(acp-bridge): keep loop turn error on refresh after idle bookkeepi…
qwen-code-dev-bot f4f18fe
chore: merge main into fix/web-shell-loop-detection-error
qwen-code-dev-bot 6e4c182
Merge branch 'main' into fix/web-shell-loop-detection-error
qwen-code-dev-bot 6efa3ca
fix(acp-bridge): harden loop-protection turn state per review feedbac…
qwen-code-dev-bot 209a28e
Merge remote-tracking branch 'origin/main' into fix/web-shell-loop-de…
qwen-code-dev-bot 91ba419
fix(acp): gate channel-turn classification and harden loop-error refr…
qwen-code-dev-bot a47e0b5
fix(acp): close loop-protection bypasses in delivery classification a…
qwen-code-dev-bot 8af27d0
Merge remote-tracking branch 'origin/main' into fix/web-shell-loop-de…
qwen-code-dev-bot c8fe629
fix(acp): cover idle workspace fan-out events in the refresh-append a…
qwen-code-dev-bot f291d23
Merge remote-tracking branch 'origin/main' into fix/web-shell-loop-de…
qwen-code-dev-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Web Shell loop-detection turn errors | ||
|
|
||
| ## Problem | ||
|
|
||
| ACP loop protection currently records unstarted tool calls as failures and then completes the prompt with `stopReason: end_turn`. Web Shell therefore presents the internal tool skip text as the only explanation and treats the turn as successful. | ||
|
|
||
| ## Design | ||
|
|
||
| When a foreground ACP prompt is stopped by loop protection, preserve completed and skipped tool results as today, then reject that prompt with a structured ACP request error. The bridge publishes the existing `turn_error` terminal with `errorKind: loop_detected` and the detector's `loopType`. Cancellation continues to take precedence when it races the loop stop. | ||
|
|
||
| Web Shell renders `loop_detected` from the structured kind, using localized plain language: the model repeated tool use or reached a safety limit, only the current turn stopped, and the user can continue with a more specific instruction. No client matches the internal English tool error. | ||
|
|
||
| Skipped tools keep their existing failed terminal update and error details so they cannot remain pending and their display behavior does not change. The additional `turn_error` provides the user-facing explanation for the stopped turn. | ||
|
|
||
| The session remains alive and the per-turn loop state is recreated for the next prompt. Cron and background-notification work keep their existing non-interactive handling. | ||
|
|
||
| When Web Shell reloads a live session from paginated persisted history, the bridge appends the current in-memory `turn_error` to that replay. This keeps the terminal error visible across a page refresh without changing historical persistence. | ||
|
|
||
| ## Compatibility | ||
|
|
||
| `turn_error` already terminates prompts and returns the UI to idle. Adding a known error kind and optional metadata is backward-compatible: older clients show the daemon message, while updated clients show localized guidance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] R4-5 — Deferred, not dropped: this round ran under a budget warning (the previous round exhausted its time budget), so only the Critical finding and the base-conflict resolution were addressed and verified; remaining suggestions are recorded for a follow-up round. The proposed assertion on the mock page's unique payload (
'persisted turn content'/ recordId'record-loop-page') to pin the persisted-source refresh path remains valid.中文说明
[Suggestion] R4-5 — 推迟而非丢弃:本轮在预算警告下执行(上一轮耗尽了时间预算),因此只处理并验证了 Critical 发现与基分支冲突解决;其余建议已记录,留待后续轮次处理。 所建议的断言(用 mock 页面的唯一载荷
'persisted turn content'/ recordId'record-loop-page'钉住持久化来源的刷新路径)依然有效。