Repository navigation
fix(web-ui): avoid wait-turn handoff prompt when first turn fails or stops - #1273
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed. Summary
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #1263
When a new external Harness session fails on its first turn (e.g.
host/rejected) or stops/aborts before any turn completes, opening the Composer Harness picker previously still showed"当前轮次完成后可交接上下文。"("Available after the current turn finishes."), misleading users to keep waiting even though the session is no longer running.Root Cause
resolveHandoffPointinapps/web-ui/packages/client/ui-model-selection/src/client/handoff.tsdid not inspectsession.runningand returned{ status: "pending" }for every non-ready session without a completed turn.HarnessSelect.tsxthen unconditionally mappedhandoffStatus === "pending"toharness.handoffWaitTurn.Changes
apps/web-ui/packages/client/ui-model-selection/src/client/slots.ts: Add"unavailable"toHarnessHandoffStatusto distinguish a stopped session with no completed context from an actively running turn ("pending").apps/web-ui/packages/client/ui-model-selection/src/client/handoff.ts: Requirerunning: booleanonHandoffSessionSnapshotLikeand return"pending"only whensession.running === true; otherwise return"unavailable"when no completed turn exists. Existing"ready"resolution (completed turn, fallback to last completed turnatSeq, orhasMore) is unchanged.apps/web-ui/packages/client/ui-model-selection/src/client/HarnessSelect.tsx&locales.ts: Renderharness.handoffNoContext("暂无已完成的轮次可交接上下文。"/"No completed turn available to hand off yet.") for"unavailable", keeping"pending"strictly for actively running turns and"ready"unchanged.apps/web-ui/packages/client/ui-model-selection/test/handoff.test.ts: Cover running vs. stopped empty/aborted/errored first turns as well as retry-in-progress cases.UI Note
Footer label text only (no layout or styling changes): replaces the misleading
"当前轮次完成后可交接上下文。"/"Available after the current turn finishes."footer label with"暂无已完成的轮次可交接上下文。"/"No completed turn available to hand off yet."whenhandoffStatus === "unavailable". Live screenshot capture was not run in this isolated worktree (host launch commands are intentionally skipped).Validation
npx vitest run --config tests/vitest.config.js apps/web-ui/packages/client/ui-model-selection/test/(3 files, 12 tests passed)npx tsc --noEmit -p apps/web-ui/tsconfig.json(passed)npx prettier --checkon all 5 modified files (passed)npx tsc -b packages/shared-contracts packages/desktop-control && npm run build:web:ui(passed)