Repository navigation
feat(sessions): find sessions worth organizing - #126177
vyctorbrzezowski wants to merge 9 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
beed12f to
6f2636f
Compare
|
Remote Control UI proof on final head
session-transcript-search.mp4 |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: blocked before merge. Reviewed September 3, 2026, 10:29 AM ET / 14:29 UTC. ClawSweeper reviewWhat this changesAdds session-organization search filters and a message-oriented result mode across agent tools, Gateway, native clients, UI, docs, and tests. Merge readiness⛔ Blocked before merge - 5 items remain Keep open: the branch adds session-discovery behavior not present on current main, but it advertises an unsupported icon filter and needs repair plus a current-main restack. Priority: P2 Review scores
Verification
How this fits togetherSession tools let agents inspect and organize sessions through Gateway-backed list and search operations. Tool schemas and descriptions guide model calls, while Gateway and native clients apply filters and return bounded session results. flowchart LR
A[Agent request] --> B[Session tool schema]
B --> C[Tool description]
B --> D[Gateway session search]
C --> A
D --> E[Session records]
D --> F[Native and UI clients]
E --> G[Bounded search results]
F --> G
Decision needed
Why: The feature remains absent from current main, but its closed unmerged base and subsequent session-tool redesign require an owner to choose whether the capability is worth reintegrating. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +321, Tests +388, Docs +8, Other +36. Total +753 across 44 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Repair the prompt/docs claim, then implement only the distinct discovery capability as a narrow current-main restack using current group vocabulary and actual supported filters. Do we have a high-confidence way to reproduce the issue? Yes: the model-facing description explicitly claims icon filtering while the PR input schema omits icon; an icon-filter tool call is therefore schema-rejected, although no execution was run in this read-only review. Is this the best way to solve the issue? No: correcting the unsupported promise is necessary, and the remaining feature needs a fresh main-aligned design and validation pass rather than merging the stale stack. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 79f0df31c8eb. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
Superseded by @steipete's session tool rework on |
Related: #126064, #118910, #118912
Stacked on #126146.
What Problem This Solves
Agents can organize sessions in batch, but existing metadata filtering is incomplete, and transcript search limits messages before diversifying by session. One conversation with many strong hits can therefore hide other matching sessions.
Why This Change Was Made
sessions.listandsessions_listgain cheap metadata filters for category, owner, unread state, run status, project, worktree presence, and attention. The Gateway applies them before sorting, pagination, row projection, title derivation, or transcript preview reads.sessions_searchgainsresultMode: "sessions", capped at 100. The existing SQLite FTS5 query groups by durablesessionIdbefore applying the limit and returns one best bounded excerpt per session. It never hydrates complete transcripts or adds an index/table.This broader canonical implementation explicitly supersedes the narrower category-only search in #118912 without editing or landing that contributor PR.
User Impact
An agent can search for a topic, inspect one result per matching session, and use the stacked batch tool to group up to 100 sessions in two model tool calls.
Evidence
All validation ran remotely; no tests, checks, builds, mock servers, or runtime proof ran on the development host.
tbx_01m0c2b41z73stqkfy6bk0mgbf: 75/75 focused FTS, Gateway, filter-owner, pre-hydration, and agent-adapter tests passed.tbx_01m0c2pcq5qj50ftnfmrtfh0jk: 188/188 protocol, FTS, Gateway, embedded parity, agent-tool, and Control UI tests passed.tbx_01m0c42zyxk68mtvhb5qtqmpa6: 188/188 passed.truncated: true; a hot session with four hits no longer hid another session at limit 2.tbx_01m0c33de0hnra2ybsghd45bah: protocol-since guard, Swift/Kotlin generation checks, and full build passed; Control UI startup stayed within budget.tbx_01m0c7cpszxst7tzmbjcffv270: 296 focused protocol, Gateway, FTS, and embedded-tool tests passed after the schema/handler ownership split.tbx_01m0ca4ncjccf1fde7pm7y03ha: full build passed after changed typecheck, lint, guard, and docs gates completed cleanly in run32220762269.tbx_01m0cbd652t68thcqa9tw0b0dy: 7/7 focused Control UI E2E tests passed for the explicitresultMode: "messages"request contract.Provenance
The existing FTS session search landed in #105057 and the Gateway handler split in #107677. Category search is tracked by #118910/#118912. This PR extends those canonical owners instead of adding a second search engine.
Production-vs-test LOC
Production/docs/generated: +498/-214 (net +284). Tests/test fixtures: +283/-45 (net +238). The ownership cleanup moves
sessions.searchout ofsessions-read.tsand leaves that file 143 lines smaller. Persistence remains unchanged.Exact-head repair evidence
Head
7a0a28e74e3d2bc7aa415e4a7b5184ea7af3d0aerebases this PR onto the current #126146 head and resolves the review findings:sessions.listnow uses one canonical live-run projection for both status filtering and returned row status in Gateway and embedded mode. A persistedfailedrow with a live run is found bystatus: \"running\"and returned as running.resultModevalues; both valid modes remain accepted.pnpm buildpassed.test/scripts/package-mac-app.test.tsexpectation for missing pnpm/corepack stderr; it reproduces in isolation and does not touch this PR surface.codex-rs/protocol/src/dynamic_tools.rsandcodex-rs/app-server/src/dynamic_tools.rs: dynamic tool input schemas remain JSON schema and failed calls remain explicitly typed.Repair commits production delta: +142/-71 (net +71); tests: +139/-7 (net +132). The production growth is the shared live-run projection contract plus native fallback parity; duplicate Gateway filter/row recomposition was removed.