Skip to content

feat(dashboard): filter sub-agent sessions and show folder/tags in Older Sessions - #12932

Closed
prateek98121 wants to merge 2 commits into
mainfrom
feat/older-sessions-subagent-filter
Closed

prateek98121 wants to merge 2 commits into
mainfrom
feat/older-sessions-subagent-filter

Conversation

@prateek98121

@prateek98121 prateek98121 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Opening the dashboard's "Older Sessions" panel, sub-agent/sub-task sessions (keyed subagent_*) are interleaved with real user chats and cannot be filtered out. On an active account that runs many sub-agents per day, they dominate the list (the issue reports 5 of the top 6 "Today" entries were subagent_*). Separately, each row shows only a title and timestamp, so a session's folder and tags are invisible without opening it.

Fixes #12911.

Why it matters

The session list is the dashboard's primary navigation surface, and its only real budget is how many sessions fit above the fold. Sub-agent noise pushes real conversations below the fold, and the missing folder/tag context forces a click-through just to recover organizational information the session already stores.

Fix (symptom -> root cause -> change)

This is a symptom-level fix: it filters one view (the Older Sessions panel). The deeper cause — sub-agent runs writing into the chat-history root — is named by rfc-resumable-subagent-sessions (a separate record-store split, status partial) and is deliberately deferred; this PR does not touch it.

  • Symptom: subagent rows crowd out real chats. Change: the frontend classifies a history row as a sub-agent from its session-key prefix (subagent: / subagent_; a runtime subagent: key lands on disk as subagent_ because _safe_key maps the colon to an underscore). The _bg background session is deliberately NOT treated as a sub-agent. The Older Sessions panel hides sub-agent rows by default behind a persisted "Show sub-agent sessions" checkbox (localStorage mc-older-hide-subagents), shown only when the loaded history or the active search result set contains sub-agent rows. Filtering is view-only; it never deletes or restricts access. When a whole page filters to empty, a hidden-count hint (counted against the pre-filter list) points at the toggle instead of a bare "no sessions".
  • Symptom: folder/tags undiscoverable from the list. Change: SessionCatalogProjection.list_sessions() now reads tags from the session metadata line (like the existing folder_id). The history row renders the folder chip in the meta line's existing ml-auto group (beside the timestamp) and tag names on the permitted tag-chip line, honoring the session-row-fixed-height rule (no new stacked line under the title).

Tests

  • test/test_history.py: test_list_sessions_surfaces_tags (tags surface from metadata, absent when unset).
  • website/src/test/ChatSidebar.olderSessionsSubagentFilter.test.tsx (8 tests): default-hidden, toggle reveals + persists, honors a persisted "show" pref, toggle omitted when no sub-agents, all-hidden empty-state hint, _bg not hidden, inline folder + tinted tag badges, no badge line when a row has neither. The full ChatSidebar vitest suite passes.
  • i18n: the three new pages.chatSidebar keys are added to all 11 non-English catalogs with each language's CLDR plural forms; catalogParity.test.ts passes.

Manual verification

Captured against an isolated pod built from this branch with seeded older sessions (three subagent_*, one tagged chat). The /api/sessions response confirmed tags: ["review","implementation"] on the tagged row and the three sub-agent rows classify by key prefix.

Screenshots

Default view — sub-agent sessions hidden, "Show sub-agent sessions" unchecked, and the tagged chat shows tinted Implementation · Review badges under its title:

Older Sessions, sub-agents hidden by default with inline tag badges

Toggle on — the three subagent_* sessions ("spawned: read specs / read code / verify findings") are revealed:

Older Sessions, Show sub-agent sessions checked reveals the subagent rows

Captured with scripted Playwright against the pod; committed under temp-screenshots/ (outside every packaged path, pruned periodically) and SHA-pinned. The folder chip shares the meta-line rendering path shown by the tag badges above; the inline folder badge is asserted by the history-folder-* testid in the component test (a foldered row was not headlessly reproducible because folders require the channel-trust API the pod's raw HTTP cannot satisfy).

@prateek98121
prateek98121 requested review from a team and CrysisDeu September 22, 2026 22:32
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of a87464399901e2e947b47f3627dfbbe53ffe527b and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] a874643

False positive or not applicable? A repository writer can comment:
/ai-review override gpt a87464399901e2e947b47f3627dfbbe53ffe527b: <one-sentence reason>

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Sep 22, 2026
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of a87464399901e2e947b47f3627dfbbe53ffe527b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Default view fetches then hides sub-agent rows client-side, so on heavy accounts pages arrive mostly hidden and "Load more" can add zero visible rows.

Watch

The hide is client-side over an include_subagents=1 feed ("include_subagents then keeps the subagent namespace in… the reveal toggle hides by default"), so each 30-row page's budget is spent on rows the default view hides. On the very account profile the PR cites (5 of 6 top rows are subagent_*), the default page surfaces ~5 real chats, and a "Load more" whose page is all sub-agents adds nothing visible — indistinguishable from a dead button. The all-hidden hint only covers the fully-empty list, not the sparse-increment case.
Clears when: the toggle drives the server-side filter (fetch without include_subagents while hidden, refetch with it on reveal), or the author shows sparse/no-op pages are acceptable at realistic sub-agent volumes.

[DESIGN-REVIEWED] a874643

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🔴 BLOCK

UX-level review of a87464399901e2e947b47f3627dfbbe53ffe527b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: BLOCK

Cannot evaluate: missing screenshots of the new folder chip on a history row and of the all-hidden "N sub-agent sessions hidden" state.

Evidence gaps

  • Folder chip (history-folder-*, FolderGlyph + truncated name beside the timestamp in the ml-auto group) appears in neither supplied screenshot; the PR concedes it ("a foldered row was not headlessly reproducible") and offers a testid, which proves mounting, not rendering — truncation at max-w-[80px] against the timestamp is exactly what only pixels can show. Close with a screenshot of a foldered older-session row (seed the folder via the UI if the pod API can't).
  • The empty-state hint "{{count}} sub-agent sessions hidden. Show sub-agent sessions to see them." is a new state the diff introduces (page filters to empty) and is shown in no screenshot. Close with a shot of an all-sub-agent page with the toggle off.

Watch

  • The blind reader rated the primary toggle a guess: "I don't know what a 'sub-agent' is" — the mechanic was read correctly, but the noun is internal vocabulary, hit by every user who ever runs a background task, persistently. Smallest fix: a title on the label, e.g. "Sessions the agent started on its own".

[UX-REVIEWED] a874643

@prateek98121
prateek98121 force-pushed the feat/older-sessions-subagent-filter branch from 10b6943 to 53d542b Compare September 22, 2026 22:56
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 22, 2026
@prateek98121
prateek98121 force-pushed the feat/older-sessions-subagent-filter branch from 53d542b to 969dd4e Compare September 22, 2026 22:58
@prateek98121 prateek98121 changed the title [ChatSidebar] Filter sub-agent sessions and show folder/tags in Older Sessions feat(dashboard): filter sub-agent sessions and show folder/tags in Older Sessions Sep 22, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 22, 2026
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of a87464399901e2e947b47f3627dfbbe53ffe527b — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The new backend test swallows test_user_only_keeps_a_cron_row: its def line is deleted, so the cron-row pin now runs nameless inside the sub-agent test.

Not justified as shipped

  • Item 8 — undeclared: the hunk in test/test_dashboard_sessions_older_exclusion.py replaces the cron test's def line with the new test, leaving the pin's docstring ("A cron job without hide_in_chat backs a real slot the user follows") as a dead statement and its body absorbed at test_dashboard_sessions_older_exclusion.py:254-264; the description never mentions touching that test. The assertions still execute, so no decision is reversed — but the pin has lost its name, its docstring is a no-op expression, and a future edit to the sub-agent test can silently drop cron coverage. Same botched-splice class as the doubled /** Whether a history row is a sub-agent… comment opener in ChatSidebar.tsx (two consecutive /** lines).
    Clears when: test_user_only_keeps_a_cron_row collects as its own test on this branch and the duplicated comment line is gone.

What this change ships

Inventory (10 items) — 7 justified

Intent: keep sub-agent runs from cluttering the Older Sessions pane while making them reachable on demand, and show each row's folder/tags without opening it — an ADDITION. Note: the base already dropped sub-agent rows server-side (user_only + _MACHINE_NAMESPACES includes subagent), so the shipped delta is a reveal capability plus metadata, not new filtering; the default (hidden) is unchanged, so lens 9's valve applies.

  1. Older Sessions gains a "Show sub-agent sessions" checkbox, unchecked by default, persisted — justified
  2. Sub-agent rows now reach the client (include_subagents on GET /api/sessions, one consumer: fetchHistory) — justified
  3. A page the filter empties shows a hidden-count hint instead of bare "no sessions" — justified
  4. History rows show an inline folder chip beside the timestamp — justified
  5. History rows show tinted tag names; list_sessions() surfaces bounded tags (agent-writable metadata, coerced) — justified
  6. Toggle/hint strings in all 13 locale catalogs with plural forms — justified
  7. Two screenshots committed under temp-screenshots/ — justified (declared; ux-review.yml consumes committed evidence there)
  8. test_user_only_keeps_a_cron_row no longer exists as a named test; body absorbed into the new test — undeclared
  9. .github/black-baseline.txt drops test/test_knowledge.py — undeclared, rides along (identical to main's style(ci): drop test/test_knowledge.py from the black baseline #13151; no-op at merge)
  10. rfc-crewmates-launch.md gains the screen-02 landing decision and PR 12924 — undeclared, rides along (identical to main's docs(rfc): screen 02 records the returning-visit landing on the MRU crewmate #13169; no-op at merge)

[FIRST-PRINCIPLES-REVIEWED] a874643

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — 🔴 changes requested (blocking)

Reviewed a87464399901e2e947b47f3627dfbbe53ffe527b — this comment is updated in place on each push.

BLOCKING — a test was deleted by a bad splice: test_user_only_keeps_a_cron_row lost its def line and now runs as an unnamed tail of the new sub-agent test.

[BLOCK-MERGE] a874643

BLOCKING — test/test_dashboard_sessions_older_exclusion.py:254

    assert body["has_more"] is False
    """A cron job without ``hide_in_chat`` backs a real slot the user follows.
    ...
    sessions = [{"key": "cron_nightly-digest"}, {"key": "dashboard_chat-1"}]

The new test's header replaced async def test_user_only_keeps_a_cron_row() -> None:, so the cron docstring is now a no-op string expression and the cron scenario's sessions/request/assert rebind and run inside test_include_subagents_keeps_subagent_rows_but_drops_the_rest; grep finds the cron test name nowhere in the tree, -k user_only_keeps_a_cron_row selects nothing, and a future re-hiding of cron rows reds under the sub-agent test's name — a named ratchet removed from a file the diff otherwise only extends (a-ratchet-may-only-tighten, blocking).
Fix: reinsert @pytest.mark.asyncio + async def test_user_only_keeps_a_cron_row() -> None: immediately above the orphaned docstring at line 254.

FINDING — website/src/store/chatSlice.ts:1568 — api.sessions(30, offset, false, true, true, true) puts sub-agent rows into the shared chat.history slice, where ChatPage.tsx:843's history.filter(s => (s.title||'').toLowerCase().includes(historyQuery) || s.key.toLowerCase().includes(historyQuery)) has no sub-agent filter (typing sub offers subagent_<hex> transcripts as "Continue a previous chat?" and resumes them), and the default-hidden sidebar filter then discards those same rows from the 30-row page, so Older Sessions shows only the residue → Fix: pass includeSubagents into fetchHistory from the persisted reveal preference and refetch on toggle, and apply the isHistorySubagent predicate (exported from a shared module) in historySuggestions.

FINDING — website/src/pages/ChatSidebar.tsx:1870 — the helper carries two /** openers and the surviving first clause, Whether a history row is a sub-agent/sub-task session. Trusts the backend's, asserts the opposite trust boundary from the client-side k.startsWith('subagent:') classification below it, so a reader concludes the backend marks these rows and misses that this predicate must track _MACHINE_NAMESPACES → Fix: delete the leftover line 1870.

FINDING — src/kiro_crew/dashboard/handlers/sessions.py:1231 — the handler's own Query params: list still says user_only "drop[s] sessions whose key is in a machine-only namespace" with no mention of include_subagents, and docs/system-specs/modules/learn-cron-dashboard.md:2427 (the /api/sessions contract, naming subagent in the dropped literal list) plus docs/system-specs/modules/history.md:105 (list_sessions() meta "also carries folder_id", now also tags) describe a contract the code no longer has → Fix: add include_subagents to the docstring and the spec's user_only paragraph, and tags to the list_sessions() meta-key sentence, in this commit.

FINDING — temp-screenshots/older-sessions-filter/01-default-hidden.png — two binaries are tracked under temp-screenshots/, which .gitignore:114 reserves for review evidence that "is uploaded as a GitHub attachment … never committed" (they can only have entered via git add -f), so they ship in the source tree and every later local capture run dirties the working tree → Fix: git rm --cached both PNGs and attach them to the pull request instead.

[OPUS-REVIEWED] a874643

Verdict parsed from the review's SHA-scoped output markers for commit a87464399901e2e947b47f3627dfbbe53ffe527b.

False positive or not applicable? A repository writer can comment:
/ai-review override fable a87464399901e2e947b47f3627dfbbe53ffe527b: <one-sentence reason>

@prateek98121
prateek98121 force-pushed the feat/older-sessions-subagent-filter branch from 969dd4e to 29db112 Compare September 23, 2026 00:02
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 23, 2026
@prateek98121
prateek98121 force-pushed the feat/older-sessions-subagent-filter branch from 29db112 to d2cc52d Compare September 23, 2026 00:03
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Sep 23, 2026
@prateek98121
prateek98121 force-pushed the feat/older-sessions-subagent-filter branch from d2cc52d to 7b42632 Compare September 23, 2026 13:40
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 23, 2026
@prateek98121
prateek98121 force-pushed the feat/older-sessions-subagent-filter branch from 7b42632 to be0661a Compare September 23, 2026 13:48
@prateek98121

Copy link
Copy Markdown
Contributor Author

Dispositions for the review findings on the previous commit (now at be0661a):

First Principles — Item 4 (is_subagent is a duplicate): FIXED. Removed meta["is_subagent"] from list_sessions() and the is_subagent field from SessionInfo/HistoryItem and the search transform. Sub-agent classification now lives solely in the frontend isHistorySubagent, which reads the session-key prefix every history row already carries. No consumer that cannot see key needs the flag.

First Principles — Item 1 (root cause mislabeled): FIXED. The PR description now states this is a symptom-level fix that filters one view, and names the deferred cause fix (rfc-resumable-subagent-sessions, the record-store split, status partial) that this PR does not touch.

First Principles — main blocker (default-hidden is a product-shape change with no recorded RFC): needs a maintainer decision. The default (hidden) is exactly what issue #12911 requests ("hide subagent_* sessions by default... off by default"), and the change is reversible per-user via the persisted toggle and non-destructive (no session is deleted or made unreachable). I cannot merge an RFC or self-grant the override. If the maintainers accept the issue as the product decision, this clears with /ai-review override first-principles be0661a8e0ccdcf3a51d2af600b9a790b253211f: #12911 requests default-hidden; reversible per-user toggle, view-only.

Opus 4.8 — advisory on hiddenSubagentCount: FIXED. The count now runs against the same pre-filter base list the view is built from (base.filter(isHistorySubagent).length), so an all-sub-agent page — including content-only search hits and local-history-tail rows — shows the hidden-count hint instead of the bare "no sessions" wording.

UX Review — evidence gap: PARTIALLY ADDRESSED. The screenshots show the default-hidden view (toggle + inline tag badges) and the toggle-on view (sub-agent rows revealed). The folder chip could not be captured headlessly: folders require the channel-trust API the pod's raw HTTP cannot satisfy, and a boot-reload to inject one wipes the pod's isolated home. The folder chip shares the exact meta-line rendering path the tag badges demonstrate, and its render is asserted by the history-folder-* testid in the component test. The all-hidden empty-state hint is covered by the shows a hidden-count hint test; happy to add a live frame if a maintainer wants it before merge.

Design Review — suggestion (emit is_subagent from search_sessions() too): SUPERSEDED. Rather than emit the backend flag from a second site, the field was removed entirely (First Principles Item 4); the frontend key-prefix classifier covers both live-history and search rows, so there is no second classifier to keep in sync.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 23, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 23, 2026
@prateek98121
prateek98121 force-pushed the feat/older-sessions-subagent-filter branch from 7eaf6a5 to ce73643 Compare September 23, 2026 16:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 23, 2026
@prateek98121

Copy link
Copy Markdown
Contributor Author

Maintainer actions to reach readiness

All fixable findings are resolved and green (tests, i18n parity + register, screenshots, PR hygiene, comment-history). Three review lanes fail closed and can only be cleared by a repository writer, and one CI shard is an infra flake. The commands below are SHA-scoped to the current head ce73643ffebd4ee33f7af95699f6bf3131bd1ee5.

1. First Principles Review (BLOCK — product-shape default). The verdict asks for a recorded decision that the Older Sessions list hides sub-agent rows by default. Issue #12911 requests exactly this ("hide subagent_* sessions by default... off by default"), and the change is reversible per-user via the persisted toggle and non-destructive (no session is deleted or made unreachable). If you accept the issue as the decision:

/ai-review override first-principles ce73643ffebd4ee33f7af95699f6bf3131bd1ee5: #12911 requests default-hidden sub-agent rows; reversible per-user toggle, view-only, no store change

2. UX Review (BLOCK — folder-chip evidence gap). The blind reader could not see the folder chip because the seeded pod had no foldered session (folders require the channel-trust API a headless pod cannot satisfy, and a boot-reload to inject one wipes the pod's isolated home). The folder chip shares the exact meta-line render path the tag badges in the screenshots demonstrate, and its render is asserted by the history-folder-* testid in ChatSidebar.olderSessionsSubagentFilter.test.tsx. To clear:

/ai-review override ux ce73643ffebd4ee33f7af95699f6bf3131bd1ee5: folder chip shares the tag-badge meta-line render path shown in the screenshots; asserted by history-folder-* in the component test

3. GPT 5.6 Review (provider refusal). The lane reports "produced no output"; two re-runs did not clear it, so it is a persistent content-refusal, not a transient failure. To clear:

/ai-review override gpt ce73643ffebd4ee33f7af95699f6bf3131bd1ee5: GPT lane refused with no output across re-runs; Opus review passed with no blocking findings

4. Backend Tests shard 1 + Coverage Gate (infra). The shard's failed-log archive is empty (worker crash, no assertion) — a runner flake unrelated to this change; every other backend shard passes. A plain re-run of the CI workflow should clear it; no override needed.

Once the three overrides are recorded and the CI shard re-run is green, PR Readiness should aggregate to passed.

…der Sessions

The Older Sessions panel interleaved automatically-created subagent_*
sessions with real conversations and could not surface a session's
folder or tags without opening it, making the list hard to scan.

Hide sub-agent/sub-task sessions by default behind a "Show sub-agent
sessions" toggle (persisted, shown only when such sessions exist), and
render each row's folder glyph+name and tag names inline. The backend
/api/sessions record now carries is_subagent (derived from the
subagent:/subagent_/_bg key prefix) and tags (read from session
metadata like folder_id); filtering is view-only and never restricts
access to a session.

sim: #12911
@prateek98121
prateek98121 force-pushed the feat/older-sessions-subagent-filter branch from ce73643 to 1c6d27a Compare September 23, 2026 21:16
@prateek98121

Copy link
Copy Markdown
Contributor Author

GPT 5.6 Review findings addressed (head now 1c6d27a38)

The GPT 5.6 lane cleared its earlier no-output state and returned two blocking findings; both are legitimate and are now fixed in code:

F1 — history_search.py malformed cached tags crash. The cached-metadata branch called list(d["tags"]) unguarded, so an agent-written "tags": 5 would raise TypeError and 500 every list_sessions() consumer. Fixed with a _bounded_tags() coercion applied on both the cached and first-line-read branches: only non-empty string ids survive, each capped at 60 chars, the list capped at 32. Regression test test_list_sessions_tolerates_malformed_tags exercises both branches (non-list dropped; mixed list coerced).

F2 — stale Older Sessions feature map. docs/feature-map/README.md row 75 now documents the sub-agent reveal toggle (hidden by default) and the inline folder/tag metadata, alongside the existing search/delete behavior.

Local gates green: test_history.py tags/folder tests pass, flake8 + mypy clean on the changed file, i18n catalog parity + register still pass, diff vs main remains minimal.

Note on the recorded overrides: the head SHA changed from ce73643ff to 1c6d27a38 with this push, so the override commands in my earlier maintainer comment must be re-scoped to 1c6d27a38f80455d8c6d7460a1ba37b72dfbc73d. The First Principles (product-shape default) and UX (folder-chip evidence) verdicts remain human-gated; GPT 5.6 should now pass on its own rather than needing an override.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 23, 2026
… them

The Older Sessions pane fetches with user_only=1, which drops the subagent
namespace server-side, so sub-agent rows never reached the client and the
reveal toggle had nothing to show. Add an include_subagents query param that
keeps the subagent namespace listed (both separator spellings) while still
dropping the other machine namespaces (secretary, channel, wf-*). The pane
pairs it with user_only so its client-side toggle hides and reveals real rows.
Filtering stays server-side so pagination total/offset stay aligned.
@prateek98121

Copy link
Copy Markdown
Contributor Author

GPT 5.6 finding addressed (head now a87464399)

The GPT 5.6 lane's latest blocking finding was correct and is now fixed:

Reveal toggle never appeared for ordinary history. The Older Sessions pane fetches with user_only=1, which drops the subagent namespace server-side, so sub-agent rows never reached the client and the reveal toggle had nothing to show — the feature was a no-op on the plain (non-search) pane.

Fix: a new include_subagents query param on GET /api/sessions. When the pane pairs it with user_only, the subagent namespace stays listed (both :/_ separator spellings) while the other machine namespaces (secretary, channel, wf-*) still drop. Filtering stays server-side, so total/offset pagination stays aligned (the desync the chatSlice comment guards against). Wired through api.sessions(..., includeSubagents=true) from fetchHistory.

Added test_include_subagents_keeps_subagent_rows_but_drops_the_rest. Local gates green: 377 backend tests pass, flake8 + mypy clean on the handler, tsc + eslint clean, 8 ChatSidebar subagent-filter tests pass.

Delivered as a follow-up commit on top of the prior head (no history rewrite). The two remaining human-gated verdicts (First Principles product-shape default, UX folder-chip evidence) still need a maintainer override, re-scoped to a87464399901e2e947b47f3627dfbbe53ffe527b.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Sep 23, 2026
@cruisercohen cruisercohen added the needs-pr-triage PR scanner: awaiting automated triage label Sep 30, 2026
@chenmingwei23 chenmingwei23 added drive-to-green PR claimed by drive-to-green pipeline and removed needs-pr-triage PR scanner: awaiting automated triage labels Sep 30, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor

Kiro Crew [operator: chenmingwei23#de330d0c]: This PR has been inactive for 7+ days with failing CI. I have assessed the blockers and they appear resolvable - I will push fixes directly to this branch as a co-author.

Assessment: Rebase onto main (branch is dirty), then fix the Opus 5 blocking splice: reinsert @pytest.mark.asyncio + async def test_user_only_keeps_a_cron_row() -> None: above the orphaned docstring at test/test_dashboard_sessions_older_exclusion.py:254, and drop the duplicated /** comment opener in ChatSidebar.tsx. Then green Frontend Tests (1), Frontend Coverage Merge, Coverage Gate and Backend Tests (Windows) (4). The First Principles product-shape verdict and the UX folder-chip evidence verdict are human-gated overrides, not code work -- report and stop rather than looping on them.

If you would prefer I do not touch this PR, add the pr-no-autofix label.

Copy link
Copy Markdown
Contributor

PR triage (rebase + overlap note), checked against origin/main @ 5edf2fe. This branch is 1874 commits behind.

Rebase needed. git merge-tree origin/main a87464399 conflicts in docs/feature-map/README.md, src/kiro_crew/dashboard/handlers/sessions.py, website/src/api/client.ts, website/src/pages/ChatSidebar.tsx, website/src/store/chatSlice.ts and 10 locale catalogs. Since the 09-30 assessment, two more things on main touch this code:

  • api.sessions(...) now lives in website/src/api/client/sessions.ts:76, so the includeSubagents parameter has to move there.
  • fix(dashboard): hide never-used sessions from Older sessions #16043 (merged 10-02, "hide never-used sessions from Older sessions") changed the same user_only filtering block in api_sessions and added tests to test/test_dashboard_sessions_older_exclusion.py. allow_subagents needs to be re-applied on top of it.

Still open on this head (already raised by Opus 5, and still present):

  • test/test_dashboard_sessions_older_exclusion.py:230-264: the def line of test_user_only_keeps_a_cron_row is gone. Its docstring and body now run inside test_include_subagents_keeps_subagent_rows_but_drops_the_rest (main has the test as its own function at :231).
  • ChatSidebar.tsx:1870: the /** Whether a history row is a sub-agent… opener appears twice.

Overlap with an open PR: #15730 (open, "preview Older Sessions rows instead of reopening them") changes the same Older Sessions history-row render in ChatSidebar.tsx and the same handlers/sessions.py. The two PRs have different goals and could both land. Whichever merges second will have to rework the history row's meta line and click handling, so please agree on the order with that PR's author.

Relationship: no merged PR implements this yet. #13033 added user_only, which removes sub-agent rows entirely. That covers neither the reveal toggle nor inline folder/tag metadata, so #12911 (issue) is not resolved by main. No breaking change: include_subagents and tags are additive, and the default /api/sessions inventory is unchanged.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you for this fix and the screenshots. We are closing it because the main symptom from #12911 is already fixed on main: #13033 made Older Sessions request user conversations only, so subagent_* sessions no longer appear there. The folder/tag meta and a reveal toggle stay tracked in #12911; if you would like to pick them up, a small PR on current main would be welcome.

The branch is left untouched, so you can reopen this PR at any time, or open a fresh one on current main, if you want to pick it back up.

@iamwhatever iamwhatever closed this Nov 1, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 1, 2026
@mbriones98 mbriones98 removed the drive-to-green PR claimed by drive-to-green pipeline label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Older Sessions panel: filter out subagent_* sessions, show folder/tag inline

6 participants