Repository navigation
refactor: consolidate session selection result classification - #146983
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 11:45 AM ET / 15:45 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR consolidates session-match classification while preserving matching precedence and adds tests for ambiguous candidate ordering. Merge readiness✅ Ready for maintainer review No actionable defects found. This remains a useful, behavior-preserving cleanup absent from inspected main and the latest release; its member authorship and protected label also rule out automatic closure. Priority: P3 Review scores
Verification
How this fits togetherThe resume command matches a user's query against recent sessions returned by the Gateway. The result determines whether OpenClaw opens the terminal UI for one session or prints ambiguity or no-match guidance. flowchart TD
A[User session query] --> C[Session matching]
B[Recent Gateway sessions] --> C
C --> D[Exact key first]
D --> E[Substring candidates or fuzzy fallback]
E --> F[Classify candidates]
F --> G[Open selected session]
F --> H[Print matching guidance]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -5, Tests +16. Total +11 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one result-classification block in the existing resolver, preserving exact-key precedence, substring ordering, and lazy fuzzy fallback. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR claims no behavior defect; source inspection supports equivalence of the old and new classification paths. Is this the best way to solve the issue? Yes: selecting the existing candidate array once removes duplicate classification without adding another owner or changing the matching contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5541c3d396ab. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* commit '201f11afefdb19a9c75e9d3542bf7425c80df7a7': (141 commits) fix: keep catalog discovery scoped and execution lazy (#147159) fix: serialize reclamation worker shutdown with foreground writes (#147178) test(sessions): cover abrupt committed transcript recovery (#143984) fix: stop transcript storms during context overflow recovery (#147202) fix: reduce CPU overhead for small history and usage reads (#147205) fix: resume tasks after tools finish and the model times out (#147203) refactor(scripts): share SQLite reliability message waits (#146900) feat(exec): configure approval reviewer thinking and fastMode (#147192) test: remove redundant Bonjour module headers (#146981) refactor: share streaming media tail boundary update (#146989) refactor(tui): classify resume candidates once (#146983) improve: skip unused toast dismissal work (#147196) fix(linux): recover saved remote connections without replacing active sessions (#146047) fix: doctor stays silent when Windows state dir is under OneDrive (#123720) feat: announce successful Daybreak retries (#147146) feat(code-mode): reuse results across code cells (#147154) refactor(test): reuse CLI plugin fixture writer (#147186) test: skip unused compiler setup in routing fixtures (#147194) test: reuse LINE webhook runtime fixture (#146710) fix(code-mode): check automation and process result types (#147143) ...
What Problem This Solves
Session selection repeats the same result classification for substring and fuzzy matches.
User Impact
No user-visible behavior changes. Exact keys still win, nonempty substring matches retain input order, and fuzzy matching runs only when there are no substring matches.
Why This Change Was Made
Select the existing candidate list lazily, then classify it once. Production changes: −5 lines; tests: +16 lines.
Evidence
2,176 before/after comparisons matched complete result metadata and builder/fuzzy call sequences across session subsets, orderings and queries. This uses the actual resolver with a prepared-choice boundary and the actual canonical string normalizer and fuzzy implementation; it does not claim Gateway or interactive TUI execution.
Two public regression rows distinguish ambiguous substring matches from fuzzy-only candidates and preserve fuzzy result ordering. Both rows passed in the complete 45-case resume CLI suite; selected pinned type/lint/format checks passed.
The installed fuzzy implementation was directly checked against the requested upstream version's source. This verifies that algorithm only; the borrowed dependency installation is otherwise incompatible with this checkout, so package-backed proof remains hosted.
Root and independent source review, fresh P2 autoreview, diff checks and normal commit formatting passed.
Exact-head CI attempt 34755055350/1 and aggregate gate passed. The complete resume CLI suite passed all 45 cases, and the selected TUI group passed 1,615 tests. The latest exact-head review has no findings, before-merge items or rank-up requests. Hosted fixture execution does not claim a live Gateway or interactive terminal session.