Skip to content

Sidebar从订阅 sessions(每次 token flush 新引用)改为订阅 runningSession - #998

Open
zhbdesign wants to merge 2 commits into
NanmiCoder:mainfrom
zhbdesign:patch-26
Open

Sidebar从订阅 sessions(每次 token flush 新引用)改为订阅 runningSession#998
zhbdesign wants to merge 2 commits into
NanmiCoder:mainfrom
zhbdesign:patch-26

Conversation

@zhbdesign

Copy link
Copy Markdown
Contributor

Sidebar 和 TabBar 从订阅 sessions(每次 token flush 新引用)改为订阅 runningSession

Summary

Feature Quality Contract

  • Changed surface:
  • Tests added or updated:
  • Coverage evidence:
  • E2E / live-model evidence:
  • Known risk / rollback:

Verification

  • I ran the relevant local checks, or explained why they do not apply.
  • I added or updated same-area tests for every production behavior change.
  • I ran bun run verify for code changes, including the coverage gate.
  • New or changed executable production lines meet the changed-line coverage threshold, or the blocker/maintainer override is documented.
  • I attached or summarized the quality report path, JUnit/log artifact path, and pass/fail/skip counts.
  • I ran E2E/live smoke for cross-boundary, provider/runtime, desktop chat, agent-loop, native, or release changes, or documented the blocker.

Risk

  • This PR does not touch CLI core paths, or it has maintainer approval for allow-cli-core-change.
  • Production code changes include matching tests, or have maintainer approval for allow-missing-tests.
  • Coverage baseline/threshold changes have maintainer approval for allow-coverage-baseline-change.
  • Quarantined tests still have owners, exit criteria, and unexpired review windows.
  • Provider/runtime changes were covered by mock contract tests, and live smoke was run or explicitly deferred.

@dosubot review this PR for changed-area risk, missing tests, docs impact, desktop startup risk, and CLI core impact.

Sidebar 和 TabBar 从订阅 sessions(每次 token flush 新引用)改为订阅 runningSession
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

PR quality triage

Changed areas: area:desktop

CLI core policy: No CLI-core policy block detected.

Missing-test policy: No missing-test policy block detected.

Coverage baseline policy: No coverage-baseline policy block detected.

CLI core files:

  • none

Coverage policy files:

  • none

Expected checks:

  • change-policy
  • desktop-checks
  • desktop-native-checks
  • coverage-checks

Test coverage signals:

  • No obvious missing-test signal from changed paths.

Risk notes:

  • No special risk notes from changed paths.

Hard merge gates still come from GitHub Actions, not AI review.

Dosu handoff: Dosu can be used as the AI reviewer for risk explanation, missing-test prompts, and maintainer Q&A. If it does not comment automatically from the PR template, ask:

@dosubot review this PR for changed-area risk, missing tests, docs impact, desktop startup risk, and CLI core impact.

@dosubot

dosubot Bot commented Jul 10, 2026

Copy link
Copy Markdown

Here's my review of PR #998 across the requested dimensions:

Changed-Area Risk: Low
The change is a focused performance optimization in the Sidebar component, replacing a broad sessions subscription with a derived chatRunningSessionIds array using useShallow [1]. The logic itself is straightforward — filtering for non-idle sessions and sorting the IDs — and the risk of functional regression is low. However, there's a subtle correctness concern: the new hook filters on chatState !== 'idle' || hasRunningBackgroundTasks(...), so if the filtering criteria ever diverge from what the old chatSessions iteration checked, running indicators could appear/disappear incorrectly. Worth a quick manual verification that the indicator behavior matches the old path exactly.

Missing Tests: Flagged
No test files are included [2]. For a UI subscription change like this, a unit test verifying that runningSessionIds is correctly computed (e.g., returns only non-idle session IDs and merges tab statuses properly) would provide confidence against regressions — especially since the dependency array changed from [chatSessions, tabs] to [chatRunningSessionIds, tabs]. The allow-missing-tests label was applied, but the risk of a silent regression in the running-session indicator without test coverage is non-zero.

Docs Impact: None
This is an internal subscription optimization with no user-facing API or behavior change. No documentation updates needed.

Desktop Startup Risk: None
The changes are localized to runtime subscription logic in the Sidebar component and do not touch initialization, window creation, or startup paths [2].

CLI Core Impact: None
All changes are scoped to area:desktop UI components only — no CLI core paths are affected [2].

Summary: This is a low-risk, performance-focused PR. The main gap is the lack of a unit test for the new chatRunningSessionIds derivation logic. I'd recommend at minimum a test asserting the hook produces the correct sorted array given mock store state, to guard the changed dependency in useMemo.


Leave Feedback Ask Dosu about cc-haha

@zhbdesign zhbdesign changed the title Sidebar 和 TabBar 从订阅 sessions(每次 token flush 新引用)改为订阅 runningSession Sidebar从订阅 sessions(每次 token flush 新引用)改为订阅 runningSession Jul 10, 2026
Sidebar从订阅 sessions(每次 token flush 新引用)改为订阅 runningSession
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desktop size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants