Skip to content

feat(frontend): @agenta/sessions, the headless session-list package - #5769

Closed
ardaerzin wants to merge 1 commit into
pkg/ui-surfacesfrom
pkg/sessions
Closed

feat(frontend): @agenta/sessions, the headless session-list package#5769
ardaerzin wants to merge 1 commit into
pkg/ui-surfacesfrom
pkg/sessions

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Context

Second lane of the sessions/agents UX stack. The session list's rules (filter semantics, grouping, row derivation, pins) lived inside SessionsPage, so every surface that shows sessions (Home, overview, the sidebar, and later mobile) re-derived its own. The test this package is held to: changing a rule, like "automations replace the set rather than adding to it", must be one edit that every surface inherits.

Changes

New headless package @agenta/sessions (hooks and atoms only, zero UI imports, enforced by eslint):

  • state/: the filter atoms with their semantics (show-triggered is a mode that replaces the set; show-archived widens it), per-project pins, the infinite list query with cursor handling and the waitingSessionIds pushdown, and the grouping hooks useSessionsList / useSessionCardList that return render-ready groups plus paging state.
  • row/: title, status, preview and trigger helpers plus SessionRowVm, so a row reaches the UI with nothing left to decide.

The session entity keeps what it owns in @agenta/entities/session: the zod schema, listOptions, rowStatus and the query itself. web/.gitignore learns about the package's vitest junit output.

Tests / notes

  • 21 unit tests in tests/unit (title, status, preview) pass; package builds under turbo.
  • grep 'from "antd"' src is empty; @agenta/oss tsc is clean on this lane.

@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 6, 2026
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 6, 2026 1:24pm

Request Review

@dosubot dosubot Bot added feature request New feature or request frontend labels Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b544599d-28af-424c-aa42-a0f5b26be24c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added session filtering by search, agent, status, archive state, liveness, and automation origin.
    • Added project-specific pinned sessions with prioritized display.
    • Added grouped waiting, pinned, and recent session views with pagination and “show more.”
    • Added clearer titles, previews, activity statuses, and pending-action labels.
    • Added session metadata, message previews, and durable agent mount support.
  • Tests

    • Added coverage for session previews, titles, statuses, and pending actions.

Walkthrough

This PR adds the @agenta/sessions package. It provides session query utilities, row view models, filters, pins, pagination, pending-interaction tracking, grouped list hooks, and card-list hooks. It also extends session APIs and integrates package validation into OSS workflows.

Changes

Session orchestration

Layer / File(s) Summary
Session query contracts and APIs
web/packages/agenta-entities/src/session/api/api.ts, web/packages/agenta-entities/src/session/core/*, web/packages/agenta-entities/src/session/state/listOptions.ts
Session queries now support liveness, ID, origin, and pagination filters. Agent mounts can be queried with retry and response validation. Session schemas include tags and last-message previews.
Session row presentation
web/packages/agenta-sessions/src/row/*, web/packages/agenta-sessions/tests/unit/*
Adds trigger parsing, preview and title resolution, status metadata, pending-gate labels, and session-row view models. Unit tests cover preview, title, and status behavior.
Session filters, pins, and list hooks
web/packages/agenta-sessions/src/state/*
Adds Jotai filters and project-scoped pins. List hooks poll actionable interactions, query paginated sessions, group pinned and recent rows, deduplicate results, and support card-list expansion.
Package exports and build integration
web/packages/agenta-sessions/package.json, web/packages/agenta-sessions/src/index.ts, web/oss/package.json, web/oss/next.config.ts, web/turbo.json, .gitignore
Creates the private package, exposes row and state APIs, adds OSS transpilation and dependency wiring, configures build, lint, type-check, and test tooling, and ignores test results.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SessionList
  participant PendingInteractions
  participant SessionQuery
  participant SessionAPI
  SessionList->>PendingInteractions: poll actionable interactions
  SessionList->>SessionQuery: build filtered paginated query
  SessionQuery->>SessionAPI: request session page
  SessionAPI-->>SessionQuery: return session rows
  SessionQuery-->>SessionList: return grouped and mapped rows
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the new headless @agenta/sessions package, which is the primary change.
Description check ✅ Passed The description directly explains the new package, its responsibilities, architecture, and validation results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pkg/sessions

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-08-09T16:56:39.002Z

@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
web/packages/agenta-entities/src/session/api/api.ts (1)

330-346: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Narrow the type assertion so the known request fields stay checked.

The as assertion covers the whole object literal. It also disables excess-property and type checking for references, include_ended, include_archived, and windowing. A future typo in those fields will not fail the build. Assert only the unsupported extension instead. Also update the TODO text: it omits origin and exclude_origin, which are part of the same widening.

♻️ Proposed refactor to keep the generated fields type-checked
-            {
-                references,
-                include_ended: includeEnded,
-                include_archived: includeArchived,
-                windowing,
-                // TODO(fern-regen): `search`/`flags`/`session_ids`/`exclude_session_ids` aren't in
-                // the generated SessionQueryRequest yet (regen out of scope) — widen the type
-                // until the client picks them up.
-                search,
-                flags,
-                session_ids: sessionIds,
-                exclude_session_ids: excludeSessionIds,
-                origin,
-                exclude_origin: excludeOrigin,
-            } as AgentaApi.SessionQueryRequest & {
-                search?: string
-                flags?: QuerySessionsParams["flags"]
-                session_ids?: string[]
-                exclude_session_ids?: string[]
-                origin?: string
-                exclude_origin?: string
-            },
+            {
+                ...({
+                    references,
+                    include_ended: includeEnded,
+                    include_archived: includeArchived,
+                    windowing,
+                } satisfies AgentaApi.SessionQueryRequest),
+                // TODO(fern-regen): `search`, `flags`, `session_ids`, `exclude_session_ids`,
+                // `origin` and `exclude_origin` aren't in the generated SessionQueryRequest yet
+                // (regen out of scope) — widen the type until the client picks them up.
+                search,
+                flags,
+                session_ids: sessionIds,
+                exclude_session_ids: excludeSessionIds,
+                origin,
+                exclude_origin: excludeOrigin,
+            } as AgentaApi.SessionQueryRequest,

As per coding guidelines: "For workspace packages, respect the hierarchy ... avoid any and legacy compatibility shims".

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bc46def3-60c0-48e9-8061-42ee14807040

📥 Commits

Reviewing files that changed from the base of the PR and between f800d4a and 3c7af0a.

⛔ Files ignored due to path filters (1)
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (29)
  • .gitignore
  • web/oss/next.config.ts
  • web/oss/package.json
  • web/packages/agenta-entities/src/session/api/api.ts
  • web/packages/agenta-entities/src/session/core/rowStatus.ts
  • web/packages/agenta-entities/src/session/core/schema.ts
  • web/packages/agenta-entities/src/session/index.ts
  • web/packages/agenta-entities/src/session/state/listOptions.ts
  • web/packages/agenta-sessions/eslint.config.mjs
  • web/packages/agenta-sessions/package.json
  • web/packages/agenta-sessions/src/index.ts
  • web/packages/agenta-sessions/src/row/index.ts
  • web/packages/agenta-sessions/src/row/sessionPreview.ts
  • web/packages/agenta-sessions/src/row/sessionRowStatus.ts
  • web/packages/agenta-sessions/src/row/sessionRowTitle.ts
  • web/packages/agenta-sessions/src/row/sessionTrigger.ts
  • web/packages/agenta-sessions/src/row/viewModel.ts
  • web/packages/agenta-sessions/src/state/filters.ts
  • web/packages/agenta-sessions/src/state/index.ts
  • web/packages/agenta-sessions/src/state/pins.ts
  • web/packages/agenta-sessions/src/state/useSessionCardList.ts
  • web/packages/agenta-sessions/src/state/useSessionList.ts
  • web/packages/agenta-sessions/src/state/useSessionsList.ts
  • web/packages/agenta-sessions/tests/unit/sessionPreview.test.ts
  • web/packages/agenta-sessions/tests/unit/sessionRowStatus.test.ts
  • web/packages/agenta-sessions/tests/unit/sessionRowTitle.test.ts
  • web/packages/agenta-sessions/tsconfig.json
  • web/packages/agenta-sessions/vitest.config.ts
  • web/turbo.json

Comment thread web/packages/agenta-sessions/src/row/viewModel.ts
Comment on lines +22 to +32
* Cadence mirrors mobile: 15s while anything is pending (a running turn is what mints new gates),
* stopped when idle, re-checked on focus.
*/
export const useActionableInteractions = (projectId: string) =>
useQuery<SessionInteraction[] | null>({
queryKey: ["sessions-page", "actionable-interactions", projectId],
queryFn: ({signal}) =>
queryInteractions({projectId, actionableOnly: true, abortSignal: signal}),
enabled: Boolean(projectId),
staleTime: 10_000,
refetchInterval: (query) => ((query.state.data?.length ?? 0) > 0 ? 15_000 : 30_000),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

The comment contradicts the polling cadence.

The comment states the poll is "stopped when idle". refetchInterval returns 30_000 when no interaction is pending, so the poll continues at 30s. Correct the comment, or return false if a full stop is intended.

📝 Proposed comment correction
- * Cadence mirrors mobile: 15s while anything is pending (a running turn is what mints new gates),
- * stopped when idle, re-checked on focus.
+ * Cadence mirrors mobile: 15s while anything is pending (a running turn is what mints new gates),
+ * 30s when idle, re-checked on focus.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* Cadence mirrors mobile: 15s while anything is pending (a running turn is what mints new gates),
* stopped when idle, re-checked on focus.
*/
export const useActionableInteractions = (projectId: string) =>
useQuery<SessionInteraction[] | null>({
queryKey: ["sessions-page", "actionable-interactions", projectId],
queryFn: ({signal}) =>
queryInteractions({projectId, actionableOnly: true, abortSignal: signal}),
enabled: Boolean(projectId),
staleTime: 10_000,
refetchInterval: (query) => ((query.state.data?.length ?? 0) > 0 ? 15_000 : 30_000),
* Cadence mirrors mobile: 15s while anything is pending (a running turn is what mints new gates),
* 30s when idle, re-checked on focus.
*/
export const useActionableInteractions = (projectId: string) =>
useQuery<SessionInteraction[] | null>({
queryKey: ["sessions-page", "actionable-interactions", projectId],
queryFn: ({signal}) =>
queryInteractions({projectId, actionableOnly: true, abortSignal: signal}),
enabled: Boolean(projectId),
staleTime: 10_000,
refetchInterval: (query) => ((query.state.data?.length ?? 0) > 0 ? 15_000 : 30_000),

Comment on lines +83 to +100
const shared = {
search,
agentId,
status,
includeArchived,
showTriggered,
waitingSessionIds: waitingIds,
}
const pinnedQuery = useSessionList({
...shared,
sessionIds: pinnedIds,
enabled: pinnedIds.length > 0,
})
const listQuery = useSessionList({
...shared,
origin: showTriggered ? "trigger" : undefined,
excludeSessionIds: pinnedIds,
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate files =="
fd -a 'useSessionsList.ts|useSessionCardList.ts|useSessionList.ts|listOptions.ts|api.ts' web/packages 2>/dev/null | sed 's#^\./##' | head -80

echo
echo "== target snippets =="
if [ -f web/packages/agenta-sessions/src/state/useSessionsList.ts ]; then
  echo "--- useSessionsList.ts lines 1-150 ---"
  nl -ba web/packages/agenta-sessions/src/state/useSessionsList.ts | sed -n '1,150p'
fi

if [ -f web/packages/agenta-sessionssrc/state/useSessionCardList.ts ]; then
  echo "--- useSessionCardList.ts lines 1-150 ---"
  nl -ba web/packages/agenta-sessions/src/state/useSessionCardList.ts | sed -n '1,150p'
fi

echo
echo "== useSessionList/listOptions/api predicates =="
for f in \
  web/packages/agenta-sessions/src/state/useSessionList.ts \
  web/packages/agenta-sessions/src/state/listOptions.ts \
  web/packages/agenta-entities/src/session/api/api.ts
do
  if [ -f "$f" ]; then
    echo "--- $f lines 1-180/200/total ---"
    case "$f" in
      web/packages/agenta-entities/src/session/api/api.ts) wc -l "$f"; nl -ba "$f" | sed -n '1,220p';;
      *) wc -l "$f"; nl -ba "$f" | sed -n '1,180p';;
    esac
  fi
done

Repository: Agenta-AI/agenta

Length of output: 1684


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== target snippets =="
for f in \
  web/packages/agenta-sessions/src/state/useSessionsList.ts \
  web/packages/agenta-sessions/src/state/useSessionCardList.ts \
  web/packages/agenta-sessions/src/state/useSessionList.ts \
  web/packages/agenta-entities/src/session/state/listOptions.ts \
  web/packages/agenta-entities/src/session/api/api.ts
do
  if [ -f "$f" ]; then
    lines=$(wc -l < "$f")
    echo "--- $f (lines=$lines) ---"
    awk '{printf "%6d\t%s\n", NR, $0}' "$f" | sed -n '1,180p'
  fi
done

echo
echo "== search excludeOrigin/showTriggered/usages =="
rg -n "excludeOrigin|showTriggered|sessionIds|excludeSessionIds|pin" web/packages/agenta-sessions web/packages/agenta-entities/src/session -S | sed -n '1,220p'

Repository: Agenta-AI/agenta

Length of output: 50374


🌐 Web query:

Fern generated querySessions exclude_origin request parameter origin documentation

💡 Result:

There is no documented exclude_origin request parameter for a querySessions endpoint within the Fern API definition ecosystem [1][2][3][4][5]. The term exclude_origin appears to be a specific configuration parameter associated with Cloudflare's Cache Rules (often used in Terraform configurations to define cache keys) [6][7][8][9], rather than a standard parameter for API session queries. If you are encountering this parameter in a project using Fern, it is likely that: 1. It is a custom parameter defined in your own OpenAPI specification for your querySessions endpoint [10]. 2. It is being confused with Cloudflare's cache configuration, which is frequently documented with that specific name [7][8][11]. Fern provides tools for documenting and generating SDKs for APIs [5], but it does not inherently add exclude_origin parameters to querySessions endpoints unless they are explicitly present in your source OpenAPI definition or schema [10]. To verify if this is defined in your specific API, you should check your OpenAPI specification file directly.

Citations:


🌐 Web query:

"querySessions" "sessions" "query_sessions" "exclude_origin"

💡 Result:

The terms "querySessions", "query_sessions", and "exclude_origin" do not refer to a single, unified technical standard. Instead, they appear in different contexts, primarily relating to API operations, web services, and configuration settings. 1. querySessions / query_sessions: These terms are commonly used as names for API methods or tools intended to retrieve a collection of session data [1][2][3][4]. - API Reference: Various platforms and services define methods like querySessions or query_sessions to search, filter, and list active or historical sessions based on provided parameters (such as time windows, user identifiers, or metadata) [1][2][4]. - SDKs: In game development environments like Unity's Multiplayer Services, QuerySessionsOptions is a class used to configure how sessions are queried, including sorting, pagination, and filtering [5][6]. - Backend Logic: Frameworks may distinguish between high-level listing methods (like GetSessions) and more intensive search methods (like QuerySessions) that perform full-text or advanced filtering [7]. 2. exclude_origin: This term is used as a configuration flag or a query parameter in specific applications to filter or exclude requests/entries based on their originating source [8][9]. - Web Services: In projects like webrings, exclude_origin is a boolean query parameter used to remove the site currently requesting data from the returned list of entries [8][9]. - Configuration Settings: In infrastructure as code (specifically Cloudflare's Terraform provider), exclude_origin appears within cache key settings to control whether the Origin header is included in the cache key calculation [10][11]. This helps manage cache behavior by ensuring that variations in the origin header do not unnecessarily bifurcate or invalidate cache entries [12]. There is no standard protocol that combines these terms as a single command or API specification; they are implementation-specific identifiers used within their respective technical domains [1][5][8][10].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== api endpoint around querySessions and request parameters =="
file="web/packages/agenta-entities/src/session/api/api.ts"
lines=$(wc -l < "$file")
echo "--- $file (lines=$lines) ---"
awk '{printf "%6d\t%s\n", NR, $0}' "$file" | sed -n '250,360p'

echo
echo "== repository definition/name files that might declare the endpoint =="
find web -maxdepth 4 \( -name "*.yaml" -o -name "*.yml" -o -name "*.json" -o -name "*.fern" -o -name "types.ts" -o -name "resources.ts" \) -path '*/agenta-entities/*' -print 2>/dev/null | head -80
rg -n "querySessions|query.sessions|query_sessions|query sessions|sessions" web/packages/agenta-entities/foundation web/packages/agenta-entities/src -g '*.yaml' -g '*.yml' -g '*.json' -g '*.ts' 2>/dev/null | head -160

echo
echo "== deterministic option derivation from source text =="
python3 - <<'PY'
from pathlib import Path
p = Path("web/packages/agenta-sessions/src/state/useSessionList.ts")
text = p.read_text()
checks = {
    "pinned_query_spreads_showTriggered": "...shared,\n        sessionIds: pinnedIds," in Path("web/packages/agenta-sessions/src/state/useSessionsList.ts").read_text(),
    "card_pinned_query_no_showTriggered": "const pinnedQuery = useSessionList({agentId, origin, sessionIds: pinnedIds, enabled: usePins})" in Path("web/packages/agenta-sessions/src/state/useSessionCardList.ts").read_text(),
    "use_session_list_default_showTriggered_false": "showTriggered = false" in text,
    "exclude_origin_logic": "excludeOrigin: origin || showTriggered ? undefined : \"trigger\"" in text,
}
for k, v in checks.items():
    print(f"{k}: {v}")
PY

Repository: Agenta-AI/agenta

Length of output: 11742


Prevent the pinned query from excluding trigger-origin rows.

When the main list shows non-trigger runs, the pinned query inherits showTriggered: false, so it sends excludeOrigin: "trigger". A pinned trigger-origin session is then omitted from its own group.

  • web/packages/agenta-sessions/src/state/useSessionsList.ts#L91-94: pass showTriggered: true to the pinned query.
  • web/packages/agenta-sessions/src/state/useSessionCardList.ts#L77-78: pass showTriggered: Boolean(origin) or true here too, depending on whether pins must show across card scopes.
📍 Affects 2 files
  • web/packages/agenta-sessions/src/state/useSessionsList.ts#L83-L100 (this comment)
  • web/packages/agenta-sessions/src/state/useSessionCardList.ts#L77-L78

Comment thread web/packages/agenta-sessions/src/state/useSessionsList.ts Outdated
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
web/packages/agenta-sessions/src/state/pins.ts (1)

5-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten the narrative comments.

  • web/packages/agenta-sessions/src/state/pins.ts#L5-L15: Keep one short comment that states that pins are local and project-scoped. Move future server-reconciliation rationale to package documentation.
  • web/packages/agenta-sessions/src/state/filters.ts#L14-L15: Reduce this to one short comment that states that trigger-origin sessions are hidden by default.

As per coding guidelines, keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements.

Source: Coding guidelines

web/packages/agenta-entities/src/session/core/rowStatus.ts (1)

10-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten the deriveSessionRowStatus documentation.

The block spans six lines. Keep this declaration comment to one short line. Move the pendingCount loading-state details to package documentation if callers need them.

Proposed change
-/**
- * One definition of a session's list status, shared by every surface that lists sessions.
- *
- * `pendingCount` comes from the project-wide actionable-interactions query; pass `undefined` while
- * it is unresolved, which reads the same as zero here but lets callers hold off on a "waiting"
- * filter until they actually know.
- */
+/** Derives the canonical session-list status. */

As per coding guidelines, keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 252725d9-3a55-4084-a6c1-df5adbda25f7

📥 Commits

Reviewing files that changed from the base of the PR and between 96f9e4b and e4fcd2f.

⛔ Files ignored due to path filters (1)
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (29)
  • .gitignore
  • web/oss/next.config.ts
  • web/oss/package.json
  • web/packages/agenta-entities/src/session/api/api.ts
  • web/packages/agenta-entities/src/session/core/rowStatus.ts
  • web/packages/agenta-entities/src/session/core/schema.ts
  • web/packages/agenta-entities/src/session/index.ts
  • web/packages/agenta-entities/src/session/state/listOptions.ts
  • web/packages/agenta-sessions/eslint.config.mjs
  • web/packages/agenta-sessions/package.json
  • web/packages/agenta-sessions/src/index.ts
  • web/packages/agenta-sessions/src/row/index.ts
  • web/packages/agenta-sessions/src/row/sessionPreview.ts
  • web/packages/agenta-sessions/src/row/sessionRowStatus.ts
  • web/packages/agenta-sessions/src/row/sessionRowTitle.ts
  • web/packages/agenta-sessions/src/row/sessionTrigger.ts
  • web/packages/agenta-sessions/src/row/viewModel.ts
  • web/packages/agenta-sessions/src/state/filters.ts
  • web/packages/agenta-sessions/src/state/index.ts
  • web/packages/agenta-sessions/src/state/pins.ts
  • web/packages/agenta-sessions/src/state/useSessionCardList.ts
  • web/packages/agenta-sessions/src/state/useSessionList.ts
  • web/packages/agenta-sessions/src/state/useSessionsList.ts
  • web/packages/agenta-sessions/tests/unit/sessionPreview.test.ts
  • web/packages/agenta-sessions/tests/unit/sessionRowStatus.test.ts
  • web/packages/agenta-sessions/tests/unit/sessionRowTitle.test.ts
  • web/packages/agenta-sessions/tsconfig.json
  • web/packages/agenta-sessions/vitest.config.ts
  • web/turbo.json
🚧 Files skipped from review as they are similar to previous changes (26)
  • web/packages/agenta-entities/src/session/index.ts
  • web/packages/agenta-entities/src/session/core/schema.ts
  • web/packages/agenta-sessions/tests/unit/sessionRowTitle.test.ts
  • web/packages/agenta-sessions/package.json
  • web/packages/agenta-sessions/src/index.ts
  • web/packages/agenta-sessions/tsconfig.json
  • web/oss/package.json
  • web/packages/agenta-sessions/eslint.config.mjs
  • web/packages/agenta-sessions/tests/unit/sessionPreview.test.ts
  • web/packages/agenta-sessions/src/row/index.ts
  • .gitignore
  • web/oss/next.config.ts
  • web/packages/agenta-sessions/vitest.config.ts
  • web/packages/agenta-sessions/tests/unit/sessionRowStatus.test.ts
  • web/packages/agenta-sessions/src/state/index.ts
  • web/packages/agenta-sessions/src/row/sessionPreview.ts
  • web/packages/agenta-sessions/src/row/viewModel.ts
  • web/packages/agenta-sessions/src/row/sessionRowStatus.ts
  • web/packages/agenta-entities/src/session/state/listOptions.ts
  • web/packages/agenta-sessions/src/row/sessionRowTitle.ts
  • web/packages/agenta-entities/src/session/api/api.ts
  • web/packages/agenta-sessions/src/state/useSessionsList.ts
  • web/packages/agenta-sessions/src/state/useSessionList.ts
  • web/packages/agenta-sessions/src/row/sessionTrigger.ts
  • web/packages/agenta-sessions/src/state/useSessionCardList.ts
  • web/turbo.json

Comment thread web/packages/agenta-entities/src/session/core/rowStatus.ts
Filters (mode/include semantics), pins, the infinite list query, row helpers (title, status, preview, trigger), the SessionRowVm view-model, and the grouping hooks useSessionsList/useSessionCardList move into a headless package with zero UI imports (eslint-enforced). The session entity keeps what it owns: schema, listOptions, rowStatus and the query itself in @agenta/entities/session.
@mmabrouk

mmabrouk commented Aug 9, 2026

Copy link
Copy Markdown
Member

Landed in release/v0.112.0 as part of the 0.112.0 release. The release branch now contains this work at commit ae71a92. Closing here since there is nothing left to merge.

@mmabrouk mmabrouk closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request frontend size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants