Skip to content

[Feat] Make Sessions the primary workspace for Roomote work - #1708

Draft
roomote-roomote[bot] wants to merge 27 commits into
developfrom
feature/unified-sessions-2tuskyfsof5bf
Draft

[Feat] Make Sessions the primary workspace for Roomote work#1708
roomote-roomote[bot] wants to merge 27 commits into
developfrom
feature/unified-sessions-2tuskyfsof5bf

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

​Created by Roomote. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

What changed

  • makes Sessions the primary continuity and navigation unit while preserving Task, TaskRun, worker, controller, SDK, webhook, and /task/:id contracts
  • adds additive Session persistence, task/participant/pin linkage, usage attribution, status/read/notified rollups, transactional visible-task and Fast-conversation creation, and a bounded resumable reconciliation job
  • adds the unified Session API surface for scoped list/board/search, composed timeline, detail, read state, archive/rename/pins, task resolution, cost and analytics rollups, and task-authorized detail redaction
  • ships the Session-first Home flow, full filter URL contract, command/navigation integration, responsive list/board/detail UI, execution cards and detail panels, Task workspace breadcrumbs/return paths, unread tracking, and updated public docs
  • adds independently reversible sessions_data, sessions_ui, and sessions_comms flags, with Session-aware communication links/copy and additive coarse telemetry
  • evaluates runtime Session flags without requiring Redis, while a 30-second process-local metadata cache and in-flight request coalescing prevent per-message database reads

Why this change was made

Users currently move between conversation and execution as separate top-level objects. This change keeps conversation, delegated work, review context, unread state, artifacts, pull requests, and cost under one durable Session without changing operational Task identity or runtime contracts.

The runtime flag path was also made independent of Redis after unavailable Redis connections caused cascading Cloud Agents test timeouts. The bounded local cache preserves message throughput without reintroducing Redis as a write-path dependency.

Impact

The schema change is additive and N-1 safe: migration 0063_peaceful_stature.sql creates the Session tables and indexes and adds a nullable session_id usage dimension after the migrations already present on develop. Historical billing rows are not rewritten; reads combine stamped usage with legacy reconstruction without double counting.

Rollout order is sessions_data first, then sessions_ui, then sessions_comms. Each flag defaults off and can be reversed independently. Settings changes explicitly invalidate both Redis and process-local deployment metadata caches; otherwise local metadata refreshes within 30 seconds.

The bounded backfill is idempotent, resumes from a durable cursor, and becomes a recent-Session/orphan reconciliation pass after completion. The plan defaults remain in place: composed timelines, direct explicit-workspace launches, current task authorization for execution details, Ready fast-only Sessions in All scope, full bounded backfill, and a soft /tasks redirect behind sessions_ui.

One scope item is explicitly deferred: durable multi-task Session-level notification coalescing from M12. Existing per-run Fast-parent delivery claims/dedup remain active; the new read/notified cursors and Session projection are in place for a follow-up implementation.

The final Cloud Agents suite passes all 963 tests with Redis deliberately unreachable, including focused coverage for cache TTL, concurrent-read coalescing, explicit invalidation, and Session linkage. Monorepo pre-push lint, fast type checks, and knip also pass.

@roomote-community

roomote-community Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

2 issues outstanding. See task

  • Gate task workspace Session breadcrumbs and the Session detail route on sessions_ui so the data-only rollout does not expose unified Session UI.
  • Exclude soft-deleted tasks from Session detail and timeline status calculations.
  • Allow Auto to start Fast Sessions without requiring an environment when sessions_ui is enabled.
  • Avoid an uncached deployment-settings lookup for every Fast-agent message write.
  • apps/web/src/app/(sandbox)/sessions/[sessionId]/page.tsx:160: export and configure getFastSessionTasks in the Fast-session page test mock so the legacy detail tests run.

Reviewed d8efdac

const queryClient = useQueryClient();
const [isRenameDialogOpen, setIsRenameDialogOpen] = useState(false);
const [titleDraft, setTitleDraft] = useState(task?.title ?? '');
const parentSessionOptions = trpc.sessions?.forTask?.queryOptions({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With sessions_data enabled but sessions_ui still off (the documented rollout order), this query resolves a Session and renders the new breadcrumbs for every task. Those links target /sessions/<session-id>, but the detail page falls back to a Fast-conversation lookup while sessions_ui is off, so direct-task Sessions land on a 404. Gate this query/rendering on sessions_ui as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is still not gated. The follow-up changed the detail route to resolve unified Sessions even when sessions_ui is false, so the Header's unconditional query/breadcrumb now opens the full unified Session workspace during the data-only rollout. Keep the detail route on the legacy Fast path and gate the Header Session query, tracker, breadcrumbs, and link on sessions_ui.

Comment thread apps/web/src/lib/server/sessions.ts Outdated
})
.from(sessionTasks)
.innerJoin(tasks, eq(tasks.id, sessionTasks.taskId))
.where(eq(sessionTasks.sessionId, sessionId))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This detail query does not filter soft-deleted tasks, unlike the list/hydration queries. Deleting a failed task leaves it in this result, so the session detail/timeline still displays it and deriveSessionStatus can remain blocked from a task that disappeared everywhere else. Exclude tasks.deletedAt here (and refresh the cached status when deleting).

return;
}

if (isAutoWorkspace && sessionsUiEnabled) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This branch makes Auto start a Fast Session, which needs no environment, but submitDisabledReason still disables Auto whenever the deployment has no environments. TaskPromptInput therefore prevents this branch from running on a new/no-environment deployment, leaving no way to start the newly primary Session flow. Exempt sessionsUiEnabled from that environment requirement.

@roomote-roomote

roomote-roomote Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the failed Test check in f82c6ff8 and completed the cache follow-up in 4cc33a32. Session runtime flag reads no longer require Redis; deployment metadata is cached in-process for 30 seconds with concurrent-read coalescing and explicit invalidation.

The branch is merged with current develop and mergeable. The full Cloud Agents suite passes with Redis deliberately unreachable (107 files, 963 tests), and pre-push lint, fast type checks, and knip pass. The related cache review thread was resolved after the follow-up push. See task.

Comment thread packages/feature-flags/src/server/deployment.ts Outdated
…ssions-2tuskyfsof5bf

# Conflicts:
#	apps/docs/fast-sessions.mdx
#	apps/web/src/app/(authenticated)/home/Home.tsx
#	apps/web/src/app/(sandbox)/sessions/[sessionId]/SessionWorkspace.tsx
#	packages/communication/src/fast-session-footer.ts
#	packages/db/drizzle/meta/0061_snapshot.json
#	packages/db/drizzle/meta/_journal.json
@roomote-roomote

Copy link
Copy Markdown
Contributor Author

Addressing the three remaining findings from the failed Roomote code review: Session breadcrumb flag gating, soft-deleted task exclusion/status refresh, and no-environment Session starts. Follow the task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants