Skip to content

feat: continue and fork sessions across agents, with fallback account routes - #684

Merged
pedronauck merged 22 commits into
mainfrom
continue-fork
Sep 30, 2026
Merged

pedronauck merged 22 commits into
mainfrom
continue-fork

Conversation

@pedronauck

@pedronauck pedronauck commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

What & why

When a session hits a provider limit or a signed-out account, the work is stuck with that agent. This PR lets a person or an agent take a conversation somewhere else without losing it:

  • Continue with another agent… starts a new session for a different agent (and optionally a different configured account route) with the conversation carried over. The source session stays unchanged.
  • Fork session… / Fork from here starts a second session with the same agent, either from the whole conversation or from a chosen message. It uses the agent's own ACP session/fork when the agent supports it and the source is idle. Otherwise it replays the carried context.
  • A rate-limited or signed-out turn on a user session now offers Continue with another agent… right in the provider-error notice (next_action: handoff).
  • Derived sessions show where they came from: an origin pill in the status line, a divider above their own turns, and Origin/Seed rows in the Context inspector. The dead-session action is now Restart in a new session, and it records lineage_kind: recovery.

It also ships the hard prerequisite from the same program (decision D8), fallback account tasks 01–02:

  • a fallback route can name an account through command, and an agent can declare a fallback_chain;
  • a work session moves to the next configured route when a seat refuses before ACP accepts it;
  • the accepted route is remembered for resume;
  • command fingerprints appear on every projection, and the raw command never appears in errors or logs.

Specs: .compozy/tasks/session-continue-fork/ (tasks 01–08) and .compozy/tasks/fallback-account/ (tasks 01–02). Design reference: docs/design/opendesign/session-continue-fork/. The web builds on @compozy/ui primitives and adds no new primitive.

Screenshots

Menus

Session row menu: Continue with another agent… and Fork session…

Session window overflow with the same two actions

Fork from here beside Rewind to here on a settled message

Continue with another agent

Continue dialog: agent, runtime, optional first message, carried-context preview, Open in

Continue dialog with an account route selected from the agent's fallback chain

Preview over the context budget: omitted earlier messages are counted

Pending: Starting the new session…

Refusal after the child was created: the dialog shows the diagnostic and offers Open new session

Fork

Fork dialog: whole session, same agent

Fork through a chosen message: Carries over 4 of 6 messages

Native clone line when the agent advertises session/fork

Lineage

Continued child: origin pill in the head and divider above its own turns

Continued-from divider

Forked child before its first message

Narrow window: title and agent truncate, the pill keeps its verb

Derived sessions nest under their source in the sessions list

Recovery and handoff

Dead session: Restart in a new session

Rate-limited turn offers Continue with another agent…

Inspector

Context inspector Origin and Seed rows for a fork

Origin row for a continued session

How you verified it

  • make gate passes on the head: codegen-check, go-lint, go-test (-race), sdk-go-test, js-sdk-typescript, js-web.
  • Real-user QA in isolated labs:
    • CLI/API walks on the real opencode, claude and codex adapters. Native fork works on OpenCode; Codex falls back to the carried context while the source process is alive.
    • Continue across agents, retry and replay, handoff, and account fallback chains.
    • A pre-feature home upgraded in place: migration 00122, meta.json files not rewritten, rewind rules intact.
    • Web walks, plus 23/23 visual-contract bundles against the design boards.
    • Reports are in docs/qa/reports/2026-09-2{8,9}-session-continue-fork-*.md.
  • QA found and fixed 14 product bugs. Two of them already existed on main: the Claude session/close inspection timeout and a lost rewind draft.
  • Web E2E for Continue, Fork and the failed-turn offer (web/e2e/__tests__/session-derive.spec.ts), and daemon integration E2E for the continue/fork CLI and the fallback chains.
  • Two independent review rounds by Codex (gpt-6-astra, xhigh). Round 1 had 14 findings (1 blocker) and round 2 had 3. All are fixed, each with a regression test in its owning suite.

Impact

  • CLI: new compozy session continue|fork; session new --lineage-kind; session status gains Origin/Derivation lines; agent create|update --fallback-route / --clear-fallback-chain; roles show gains a command column.
  • HTTP/UDS: new continueSession, forkSession, previewSessionDerive. Additive fields: lineage.kind, origin_*, derivation, runtime.acp_caps.supports_fork_session|supports_resume_session, fallback_chain[].command[_fingerprint], child_session_id on post-commit derive errors, and provider_error.next_action handoff/use_fallback.
  • Native tools: compozy__session_continue, compozy__session_fork; compozy__agent_create accepts fallback_chain.
  • Events: session.derived, session.fallback.used; role.fallback.used gains provider_command_fingerprint.
  • Config: [session.derive] max_replay_bytes / max_message_bytes; RoleFallback.command; agent fallback_chain.
  • Storage: migration 00122 adds sessions.lineage_kind, origin_* and a session_derivations receipt table, with a lossless backfill. Older meta.json files upgrade at read time without being rewritten.
  • Web: the session row menu, window overflow, message actions, the two new dialogs, the status line pill, transcript divider, inspector, and provider-error notice.
  • Docs: updated in packages/site (sessions lifecycle/events, CLI, API, config, providers), in the official skill references, and in COPY.md and the glossary.

Defaults I took that you may want to revisit are listed in .compozy/tasks/session-continue-fork/memory/MEMORY.md §Open Questions. Known pre-existing issue left open: docs/qa/bugs/BUG-20260929-rewind-offered-after-rewind.md.


  • make gate passes locally; this PR is delivered only after its required CI checks are green
  • New or changed behavior is covered by tests, or I explained above why not
  • If an agent wrote or co-wrote this, I named it above and verified the result myself. Written by Claude Code (Claude Opus 5.5) with Claude subagents, and reviewed by Codex (gpt-6-astra) through herdr.

🤖 Generated with Claude Code

pedronauck and others added 20 commits September 28, 2026 14:16
Checkpoint via cy-loop-tasks (iteration 2, phase B mode=tasks).

Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 3, phase B mode=tasks).

Co-Authored-By: Codex <[email protected]>
Prerequisite fallback-account task_01 for session-continue-fork task_03 (program D8).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Prerequisite fallback-account task_02 for session-continue-fork task_03 (program D8).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Checkpoint via cy-loop-tasks (iteration 4, phase B mode=tasks).

Co-Authored-By: Codex <[email protected]>
… event reconcile

Follow-up to session-continue-fork task_03: IT-021, UT-075, UT-078, UT-084, UT-086, IT-012, IT-016, UT-031.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Checkpoint via cy-loop-tasks (session-continue-fork task_04).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Checkpoint via cy-loop-tasks (iteration 6, phase B mode=tasks).

Co-Authored-By: Codex <[email protected]>
Checkpoint via cy-loop-tasks (iteration 7, phase B mode=tasks).

Co-Authored-By: Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Native fork load fallback, route command env prefix, handoff stream text, derive retry origin, stopped-source settlement, ACP session/close timeout, agent resource fallback chain, workspace derive budget, per-open idempotency key, derived child empty state, message actions during remote turns, menu width. Scenario verdicts, bug records, and QA reports for task_08.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Pass SessionMeta, derive snapshots and resolved roles by pointer; split long functions; reuse existing constants; apply formatter.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Committed derive child survives post-commit failures; clone fs/terminal callbacks isolated; no raw route command in errors; native fork revalidates the snapshot under the prompt slot; retained pre-rewind cuts; fork account inheritance across live model changes; full runtime reset on primary resume; committed child id on post-commit derive errors; non-repairing derive preflight and deleted-source replay; derive error codes; TOON fallback chain; status lineage; web fallback-chain preservation, explicit speed, fresh preview gating, provider-notice dedupe, fresh-session empty state; fallback-account IT-007/IT-008 legs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…mount

Round 1 QA re-walk repairs and scenario verdicts.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Committed child id on every post-commit derive error; CLI derive resolves the source through non-repairing owner and preview reads; web dialogs keep the committed child across edits and retries; promote diagnostic codes on post-commit derive errors; docs and act-warning fixes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
compozy-site Ready Ready Preview Sep 29, 2026 4:25pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 408 files, which is 108 over the limit of 300.

To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: Repository: compozy/compozy/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 451867ad-97a8-4525-a6de-2ea94b796501

📥 Commits

Reviewing files that changed from the base of the PR and between ecb3abc and 1a32ba2.

⛔ Files ignored due to path filters (83)
  • COPY.md is excluded by !**/*.md
  • docs/_memory/change-impact.md is excluded by !**/*.md
  • docs/_memory/glossary.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-agent-resource-drops-fallback-chain.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-claude-inspection-close-timeout.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-derive-budget-ignores-workspace-overlay.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-derive-replay-deleted-child-origin-lost.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-derive-retry-creates-second-child.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-derive-stopped-source-turn-in-progress.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-derived-child-empty-state-hidden.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-handoff-stream-error-says-retry.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-message-actions-enabled-during-remote-turn.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-native-fork-clone-load-refused.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-provider-error-notice-live-duplicate.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260928-route-command-env-prefix-not-launched.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260929-derive-refusal-below-fold.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260929-rewind-draft-lost-on-row-unmount.md is excluded by !**/*.md
  • docs/qa/bugs/BUG-20260929-rewind-offered-after-rewind.md is excluded by !**/*.md
  • docs/qa/charters/CH-session-derive-interrupt.md is excluded by !**/*.md
  • docs/qa/charters/CH-session-derive-real-agents.md is excluded by !**/*.md
  • docs/qa/charters/CH-session-derive-web.md is excluded by !**/*.md
  • docs/qa/charters/CH-session-fallback-seat.md is excluded by !**/*.md
  • docs/qa/journeys/J-14-read-a-finished-transcript.md is excluded by !**/*.md
  • docs/qa/journeys/J-15-operate-session-via-cli-api.md is excluded by !**/*.md
  • docs/qa/journeys/J-dead-session-history-recovery.md is excluded by !**/*.md
  • docs/qa/reports/2026-09-28-session-continue-fork-exec-b1.md is excluded by !**/*.md
  • docs/qa/reports/2026-09-28-session-continue-fork-exec-b2.md is excluded by !**/*.md
  • docs/qa/reports/2026-09-28-session-continue-fork-exec-c.md is excluded by !**/*.md
  • docs/qa/reports/2026-09-28-session-continue-fork-plan.md is excluded by !**/*.md
  • docs/qa/reports/2026-09-29-session-continue-fork-r1-rewalk.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-cli-session-continue.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-web-session-continue.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-web-session-fork-from-here.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-web-session-sidebar-threads.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-web-sessions-catalog-modal.md is excluded by !**/*.md
  • docs/qa/scenarios/MS-background-role-fallback.md is excluded by !**/*.md
  • docs/qa/scenarios/RT-agent-detail-runtime-live-edit.md is excluded by !**/*.md
  • docs/qa/scenarios/RT-conversation-rewind.md is excluded by !**/*.md
  • docs/qa/scenarios/RT-provider-error-handoff.md is excluded by !**/*.md
  • docs/qa/scenarios/RT-session-derive-native-fork.md is excluded by !**/*.md
  • docs/qa/scenarios/RT-session-derive-retry.md is excluded by !**/*.md
  • docs/qa/scenarios/RT-session-fallback-chain.md is excluded by !**/*.md
  • docs/qa/scenarios/RT-session-lineage-upgrade.md is excluded by !**/*.md
  • internal/api/contract/testdata/session-derive/continue-replay-child-deleted.json is excluded by !**/*.json
  • internal/api/contract/testdata/session-derive/continue-route.json is excluded by !**/*.json
  • internal/api/contract/testdata/session-derive/continue-runtime.json is excluded by !**/*.json
  • internal/api/contract/testdata/session-derive/derivation-native-failed.json is excluded by !**/*.json
  • internal/api/contract/testdata/session-derive/fork-message.json is excluded by !**/*.json
  • internal/api/contract/testdata/session-derive/fork-native-attempt-failed.json is excluded by !**/*.json
  • internal/api/contract/testdata/session-derive/fork-native-pending.json is excluded by !**/*.json
  • internal/api/contract/testdata/session-derive/preview.json is excluded by !**/*.json
  • internal/store/globaldb/schema/migrations/atlas.sum is excluded by !**/*.sum, !**/*.sum
  • internal/testutil/acpmock/testdata/auto_title_fixture.json is excluded by !**/*.json
  • internal/testutil/acpmock/testdata/browser_session_fork_fixture.json is excluded by !**/*.json
  • internal/testutil/acpmock/testdata/provider_error_fixture.json is excluded by !**/*.json
  • internal/testutil/acpmock/testdata/session_fork_fixture.json is excluded by !**/*.json
  • internal/tools/builtin/testdata/native-tool-catalog.json is excluded by !**/*.json
  • openapi/compozy.json is excluded by !**/*.json
  • packages/site/content/docs/agents/definitions.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/agents/providers.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/cli/agent/create.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/cli/agent/update.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/cli/roles/show.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/cli/session/continue.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/cli/session/fork.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/cli/session/index.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/cli/session/meta.json is excluded by !**/*.json
  • packages/site/content/docs/cli/session/new.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/configuration/config-toml.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/sessions/events.mdx is excluded by !**/*.mdx
  • packages/site/content/docs/sessions/lifecycle.mdx is excluded by !**/*.mdx
  • sdk/typescript/src/generated/contracts.ts is excluded by !**/generated/**, !**/generated/**
  • skills/compozy/references/agent-definitions.md is excluded by !**/*.md
  • skills/compozy/references/configuration.md is excluded by !**/*.md
  • skills/compozy/references/native-tools.md is excluded by !**/*.md
  • skills/compozy/references/runtime-operations.md is excluded by !**/*.md
  • web/e2e/__tests__/session-derive.spec.ts is excluded by !web/e2e/**
  • web/src/generated/compozy-openapi.d.ts is excluded by !**/generated/**, !**/generated/**, !**/*.d.ts
  • web/src/systems/session/components/stories/session-continue-dialog.stories.tsx is excluded by !**/*.stories.tsx
  • web/src/systems/session/components/stories/session-fork-dialog.stories.tsx is excluded by !**/*.stories.tsx
  • web/src/systems/session/components/stories/session-origin.stories.tsx is excluded by !**/*.stories.tsx
  • web/src/systems/settings/components/stories/roles-panel.stories.tsx is excluded by !**/*.stories.tsx
  • web/src/systems/settings/routes/settings-roles.stories.tsx is excluded by !**/*.stories.tsx
📒 Files selected for processing (408)
  • internal/acp/agent_process.go
  • internal/acp/agent_process_fork.go
  • internal/acp/agent_process_fork_test.go
  • internal/acp/client_control.go
  • internal/acp/client_protocol.go
  • internal/acp/client_start_contract_test.go
  • internal/acp/client_test_support_test.go
  • internal/acp/failure_probe_test.go
  • internal/acp/handlers.go
  • internal/acp/handlers_session_state.go
  • internal/acp/launch_identity.go
  • internal/acp/launcher.go
  • internal/acp/launcher_tool_host_test.go
  • internal/acp/permission_pending.go
  • internal/acp/provider_failure.go
  • internal/acp/provider_failure_summary.go
  • internal/acp/session_routing.go
  • internal/acp/start_accepted.go
  • internal/acp/start_process.go
  • internal/acp/start_session.go
  • internal/acp/types.go
  • internal/api/contract/acp_observations.go
  • internal/api/contract/agent_definitions.go
  • internal/api/contract/agent_observe_payloads.go
  • internal/api/contract/agents.go
  • internal/api/contract/authored_context_heartbeat.go
  • internal/api/contract/contract_test.go
  • internal/api/contract/roles.go
  • internal/api/contract/session_derive.go
  • internal/api/contract/session_lineage.go
  • internal/api/contract/session_runtime_payloads.go
  • internal/api/contract/settings_config_payloads.go
  • internal/api/core/agent_contracts_test.go
  • internal/api/core/agent_conversions.go
  • internal/api/core/agent_create.go
  • internal/api/core/authored_context_session_handlers.go
  • internal/api/core/authored_context_test.go
  • internal/api/core/conversions.go
  • internal/api/core/errors_diagnostic_payload.go
  • internal/api/core/handlers.go
  • internal/api/core/handlers_test.go
  • internal/api/core/session_create_lineage.go
  • internal/api/core/session_derive.go
  • internal/api/core/session_derive_errors.go
  • internal/api/core/session_owner.go
  • internal/api/core/session_workspace.go
  • internal/api/core/settings_roles_config.go
  • internal/api/core/workspaces.go
  • internal/api/httpapi/handlers_test.go
  • internal/api/httpapi/hooks_integration_test.go
  • internal/api/httpapi/session-clear_test.go
  • internal/api/httpapi/session_routes.go
  • internal/api/spec/schema_enum_registry.go
  • internal/api/spec/session_admission.go
  • internal/api/spec/terminal_operations_catalog.go
  • internal/api/testutil/session_stub.go
  • internal/api/udsapi/handlers_test.go
  • internal/api/udsapi/session_routes.go
  • internal/cli/agent.go
  • internal/cli/agent_commands_test.go
  • internal/cli/agent_fallback_route_flags.go
  • internal/cli/agent_mutate.go
  • internal/cli/agent_mutate_requests.go
  • internal/cli/authored_context_session_output.go
  • internal/cli/client_api_errors.go
  • internal/cli/client_session_api.go
  • internal/cli/helpers_test.go
  • internal/cli/roles.go
  • internal/cli/roles_test.go
  • internal/cli/root_structured_error.go
  • internal/cli/session_command.go
  • internal/cli/session_continue.go
  • internal/cli/session_create.go
  • internal/cli/session_derive_errors.go
  • internal/cli/session_derive_target.go
  • internal/cli/session_fork.go
  • internal/cli/session_status_output.go
  • internal/cli/session_test.go
  • internal/cli/skill_output.go
  • internal/cli/worktree_output.go
  • internal/config/agent.go
  • internal/config/agent_clone.go
  • internal/config/agent_create.go
  • internal/config/agent_edit.go
  • internal/config/agent_resource.go
  • internal/config/agent_resource_test.go
  • internal/config/agent_test.go
  • internal/config/agent_validation.go
  • internal/config/config_agent_session.go
  • internal/config/config_agent_validation.go
  • internal/config/config_test.go
  • internal/config/defaults.go
  • internal/config/fallback_chain.go
  • internal/config/launch_command.go
  • internal/config/merge.go
  • internal/config/merge_session.go
  • internal/config/merge_test.go
  • internal/config/provider_resolve.go
  • internal/config/provider_test.go
  • internal/config/roles.go
  • internal/config/roles_test.go
  • internal/config/session_derive_config.go
  • internal/daemon/auto_title_generator.go
  • internal/daemon/auto_title_role_integration_test.go
  • internal/daemon/auto_title_runtime_test.go
  • internal/daemon/boot_session_repair.go
  • internal/daemon/checkpoint_summary_summarizer.go
  • internal/daemon/checkpoint_summary_summarizer_test.go
  • internal/daemon/coordinator_runtime_session.go
  • internal/daemon/daemon_agent_definition_e2e_integration_test.go
  • internal/daemon/daemon_session_continue_e2e_integration_test.go
  • internal/daemon/daemon_test.go
  • internal/daemon/harness_context_integration_test.go
  • internal/daemon/loop_goal_command_e2e_integration_test.go
  • internal/daemon/loop_runtime_adapters_test.go
  • internal/daemon/memory_controller_role_test.go
  • internal/daemon/memory_controller_tiebreaker.go
  • internal/daemon/memory_extractor_fork.go
  • internal/daemon/memory_runtime_test.go
  • internal/daemon/native_create_tools.go
  • internal/daemon/native_create_tools_test.go
  • internal/daemon/native_session_derive.go
  • internal/daemon/native_tool_binding_groups.go
  • internal/daemon/native_tools_test.go
  • internal/daemon/role_fallback.go
  • internal/daemon/role_fallback_test.go
  • internal/daemon/role_resolver_test.go
  • internal/daemon/role_status.go
  • internal/daemon/role_status_test.go
  • internal/daemon/runtime_dream_dependencies.go
  • internal/daemon/session_manager_deps.go
  • internal/daemon/session_manager_factory.go
  • internal/demoseed/seed_sessions.go
  • internal/events/names.go
  • internal/events/registry_base.go
  • internal/events/registry_test.go
  • internal/memory/consolidation/session_fallback.go
  • internal/observe/helpers_test.go
  • internal/observe/hooks_test.go
  • internal/observe/observer_test.go
  • internal/observe/reconcile.go
  • internal/observe/reconcile_owner.go
  • internal/observe/reconcile_test.go
  • internal/providerauth/command.go
  • internal/session/acp_driver_adapter.go
  • internal/session/additional_test.go
  • internal/session/coordinator_fallback_test.go
  • internal/session/derive.go
  • internal/session/derive_commit.go
  • internal/session/derive_cut.go
  • internal/session/derive_first_prompt.go
  • internal/session/derive_handoff.go
  • internal/session/derive_native.go
  • internal/session/derive_native_bind.go
  • internal/session/derive_prepare.go
  • internal/session/derive_preview.go
  • internal/session/derive_reconcile.go
  • internal/session/derive_replay.go
  • internal/session/derive_route_bind.go
  • internal/session/derive_snapshot.go
  • internal/session/derive_test.go
  • internal/session/derive_types.go
  • internal/session/fallback.go
  • internal/session/fallback_evidence.go
  • internal/session/fallback_test.go
  • internal/session/health.go
  • internal/session/interfaces.go
  • internal/session/ledger.go
  • internal/session/liveness.go
  • internal/session/manager_attach.go
  • internal/session/manager_busy_input.go
  • internal/session/manager_clear.go
  • internal/session/manager_clear_cleanup_operation.go
  • internal/session/manager_clear_family_cleanup.go
  • internal/session/manager_clear_operation.go
  • internal/session/manager_clear_test.go
  • internal/session/manager_conversation_rewind.go
  • internal/session/manager_conversation_rewind_resume.go
  • internal/session/manager_conversation_rewind_test.go
  • internal/session/manager_create_accepted.go
  • internal/session/manager_create_prepare.go
  • internal/session/manager_derive_test.go
  • internal/session/manager_helpers.go
  • internal/session/manager_hooks.go
  • internal/session/manager_lifecycle.go
  • internal/session/manager_lifecycle_contract_test.go
  • internal/session/manager_options.go
  • internal/session/manager_prompt_admission.go
  • internal/session/manager_prompt_admission_target.go
  • internal/session/manager_prompt_contract_test.go
  • internal/session/manager_prompt_event_observation.go
  • internal/session/manager_prompt_input_event.go
  • internal/session/manager_prompt_recovery.go
  • internal/session/manager_prompt_runtime.go
  • internal/session/manager_prompt_runtime_fallback.go
  • internal/session/manager_prompt_submit.go
  • internal/session/manager_resume.go
  • internal/session/manager_resume_affinity.go
  • internal/session/manager_resume_test.go
  • internal/session/manager_runtime_model_validation.go
  • internal/session/manager_runtime_selection.go
  • internal/session/manager_session_owner.go
  • internal/session/manager_start.go
  • internal/session/manager_start_accept.go
  • internal/session/manager_start_fallback.go
  • internal/session/manager_start_launch_accepted.go
  • internal/session/manager_start_meta.go
  • internal/session/manager_start_runtime.go
  • internal/session/manager_start_session.go
  • internal/session/manager_start_storage.go
  • internal/session/manager_start_test.go
  • internal/session/manager_start_types.go
  • internal/session/manager_stop_integration_test.go
  • internal/session/manager_stop_receipt.go
  • internal/session/manager_test.go
  • internal/session/manager_test_support_test.go
  • internal/session/manager_transcript_marker.go
  • internal/session/manager_transition.go
  • internal/session/manager_transition_test.go
  • internal/session/manager_types.go
  • internal/session/manager_workspace.go
  • internal/session/perf_bench_test.go
  • internal/session/provider_lifecycle_test.go
  • internal/session/query.go
  • internal/session/query_health.go
  • internal/session/query_metadata.go
  • internal/session/query_test.go
  • internal/session/recovery_catalog.go
  • internal/session/repair.go
  • internal/session/repair_persistence.go
  • internal/session/repair_test.go
  • internal/session/resume_repair.go
  • internal/session/resume_repair_test.go
  • internal/session/resume_replay.go
  • internal/session/session.go
  • internal/session/session_accepted_route.go
  • internal/session/session_creation.go
  • internal/session/session_derivation_state.go
  • internal/session/session_info.go
  • internal/session/session_meta.go
  • internal/session/session_rename.go
  • internal/session/session_runtime_state.go
  • internal/session/session_test.go
  • internal/session/session_title.go
  • internal/session/soul.go
  • internal/session/soul_start.go
  • internal/session/spawn.go
  • internal/session/spawn_provider.go
  • internal/session/spawn_test.go
  • internal/session/stop_recovered.go
  • internal/session/stop_recovered_events.go
  • internal/session/stop_recovered_finalization.go
  • internal/session/transcript_test.go
  • internal/session/transient_model.go
  • internal/session/transient_model_test.go
  • internal/settings/config_apply_service_test.go
  • internal/settings/section_roles.go
  • internal/store/globaldb/global_db_goal_turn_runtime_integration_test.go
  • internal/store/globaldb/global_db_session.go
  • internal/store/globaldb/global_db_session_creation_identity.go
  • internal/store/globaldb/global_db_session_delete.go
  • internal/store/globaldb/global_db_session_derivation.go
  • internal/store/globaldb/global_db_session_index_test.go
  • internal/store/globaldb/global_db_session_lineage_migration_test.go
  • internal/store/globaldb/global_db_session_lineage_test.go
  • internal/store/globaldb/global_db_session_page.go
  • internal/store/globaldb/global_db_session_scan.go
  • internal/store/globaldb/global_db_session_test.go
  • internal/store/globaldb/global_db_test.go
  • internal/store/globaldb/queries/session_core.sql
  • internal/store/globaldb/queries/session_derivation.sql
  • internal/store/globaldb/schema/definitions/20_sessions.sql
  • internal/store/globaldb/schema/definitions/99_workspace_scope_integrity.sql
  • internal/store/globaldb/schema/migrations/00122_schema.sql
  • internal/store/globaldb/session_core_mapping.go
  • internal/store/globaldb/sqlcgen/models.go
  • internal/store/globaldb/sqlcgen/session_core.sql.go
  • internal/store/globaldb/sqlcgen/session_derivation.sql.go
  • internal/store/meta.go
  • internal/store/meta_test.go
  • internal/store/session_accepted_route.go
  • internal/store/session_catalog_page.go
  • internal/store/session_lineage.go
  • internal/store/session_lineage_test.go
  • internal/store/session_meta_derivation.go
  • internal/store/session_meta_types.go
  • internal/store/session_runtime_options.go
  • internal/store/session_type.go
  • internal/store/sessiondb/queries/session_core.sql
  • internal/store/sessiondb/sqlcgen/session_core.sql.go
  • internal/store/sessiondb/transcript_anchor.go
  • internal/store/store_helpers_test.go
  • internal/store/types_session.go
  • internal/store/types_session_derive.go
  • internal/store/types_transcript_anchor.go
  • internal/testutil/acpmock/cmd/acpmock-driver/command.go
  • internal/testutil/acpmock/cmd/acpmock-driver/main.go
  • internal/testutil/acpmock/cmd/acpmock-driver/session_fork.go
  • internal/testutil/acpmock/driver_cancel_test.go
  • internal/testutil/acpmock/fixture_driver_control.go
  • internal/testutil/acpmock/fixture_test.go
  • internal/testutil/acpmock/fixture_types.go
  • internal/testutil/e2e/runtime_harness_helpers_test.go
  • internal/toolmeta/native_entries.go
  • internal/toolmeta/registry_test.go
  • internal/tools/builtin/builtin_test.go
  • internal/tools/builtin/sessions.go
  • internal/tools/builtin/sessions_derive.go
  • internal/tools/builtin/toolsets.go
  • internal/tools/builtin/workspace.go
  • internal/tools/builtin_ids.go
  • sdk/go/contracts/types_001_gen.go
  • sdk/go/contracts/types_011_gen.go
  • sdk/go/contracts/types_012_gen.go
  • sdk/go/contracts/types_013_gen.go
  • sdk/go/contracts/types_014_gen.go
  • sdk/go/contracts/types_015_gen.go
  • sdk/go/contracts/types_016_gen.go
  • sdk/go/contracts/types_017_gen.go
  • sdk/go/contracts/types_018_gen.go
  • sdk/go/contracts/types_019_gen.go
  • sdk/go/contracts/types_020_gen.go
  • sdk/go/contracts/types_021_gen.go
  • sdk/go/contracts/types_022_gen.go
  • sdk/go/contracts/types_023_gen.go
  • sdk/go/contracts/types_024_gen.go
  • sdk/go/contracts/types_025_gen.go
  • sdk/go/contracts/types_026_gen.go
  • web/src/components/assistant-ui/__tests__/session-thread.test.tsx
  • web/src/components/assistant-ui/message-actions.tsx
  • web/src/components/assistant-ui/session-thread-messages.tsx
  • web/src/components/assistant-ui/session-thread-states.tsx
  • web/src/lib/api-client.ts
  • web/src/systems/agent/components/__tests__/agent-runtime-control.test.tsx
  • web/src/systems/agent/lib/__tests__/agent-detail-settings-search.test.ts
  • web/src/systems/agent/lib/agent-settings-draft.ts
  • web/src/systems/os/apps/agents/agent-detail-location.tsx
  • web/src/systems/os/apps/session/__tests__/session-window-content.test.tsx
  • web/src/systems/os/apps/session/session-window-content.tsx
  • web/src/systems/os/apps/session/use-session-window-controller.tsx
  • web/src/systems/os/apps/session/use-session-window-derive.ts
  • web/src/systems/os/components/__tests__/sessions-modal.test.tsx
  • web/src/systems/os/components/desktop-shell.tsx
  • web/src/systems/os/components/os-sessions-derive-host.tsx
  • web/src/systems/session/adapters/session-derive-api.ts
  • web/src/systems/session/components/__tests__/runtime-activity-notice.test.tsx
  • web/src/systems/session/components/__tests__/session-chat-runtime-provider.test.tsx
  • web/src/systems/session/components/__tests__/session-continue-dialog.test.tsx
  • web/src/systems/session/components/__tests__/session-fork-dialog.test.tsx
  • web/src/systems/session/components/__tests__/session-inspector.test.tsx
  • web/src/systems/session/components/__tests__/session-resume-failure.test.tsx
  • web/src/systems/session/components/__tests__/session-status-line.test.tsx
  • web/src/systems/session/components/marker-cluster-count.tsx
  • web/src/systems/session/components/provider-error-notice.tsx
  • web/src/systems/session/components/runtime-activity-notice.tsx
  • web/src/systems/session/components/session-chat-runtime-provider.tsx
  • web/src/systems/session/components/session-continue-dialog.tsx
  • web/src/systems/session/components/session-continue-divider.tsx
  • web/src/systems/session/components/session-continue-fields.tsx
  • web/src/systems/session/components/session-derive-committed-child.tsx
  • web/src/systems/session/components/session-derive-host.tsx
  • web/src/systems/session/components/session-derive-menu-items.tsx
  • web/src/systems/session/components/session-derive-placement.tsx
  • web/src/systems/session/components/session-derive-preview.tsx
  • web/src/systems/session/components/session-fork-dialog.tsx
  • web/src/systems/session/components/session-fork-fields.tsx
  • web/src/systems/session/components/session-fork-message-action.tsx
  • web/src/systems/session/components/session-inspector-origin-section.tsx
  • web/src/systems/session/components/session-inspector.tsx
  • web/src/systems/session/components/session-origin-pill.tsx
  • web/src/systems/session/components/session-row-actions.tsx
  • web/src/systems/session/components/session-status-line.tsx
  • web/src/systems/session/contexts/session-derive-context-value.ts
  • web/src/systems/session/contexts/session-fork-context-value.ts
  • web/src/systems/session/contexts/session-origin-context-value.ts
  • web/src/systems/session/derive.ts
  • web/src/systems/session/hooks/__tests__/use-session-derive.test.ts
  • web/src/systems/session/hooks/__tests__/use-session-prompt-runtime.test.tsx
  • web/src/systems/session/hooks/__tests__/use-session-topbar-slot.test.tsx
  • web/src/systems/session/hooks/use-session-continue-dialog.ts
  • web/src/systems/session/hooks/use-session-continue-runtime-options.ts
  • web/src/systems/session/hooks/use-session-derive-committed-child.ts
  • web/src/systems/session/hooks/use-session-derive-host.ts
  • web/src/systems/session/hooks/use-session-derive.ts
  • web/src/systems/session/hooks/use-session-fork-dialog.ts
  • web/src/systems/session/hooks/use-session-fork-message-action.ts
  • web/src/systems/session/hooks/use-session-message-action-gate.ts
  • web/src/systems/session/hooks/use-session-origin.ts
  • web/src/systems/session/hooks/use-session-rewind-message-action.ts
  • web/src/systems/session/hooks/use-session-runtime-extensions.ts
  • web/src/systems/session/hooks/use-session-topbar-slot.tsx
  • web/src/systems/session/index.ts
  • web/src/systems/session/lib/__tests__/session-prompt-capability.test.ts
  • web/src/systems/session/lib/provider-error.ts
  • web/src/systems/session/lib/query-keys.ts
  • web/src/systems/session/lib/session-derive-query.ts
  • web/src/systems/session/lib/session-derive-view.ts
  • web/src/systems/session/lib/session-origin.ts
  • web/src/systems/session/lib/session-runtime-render-context-value.ts
  • web/src/systems/session/lib/session-runtime-render-context.tsx
  • web/src/systems/session/lib/session-thread-read-model.ts
  • web/src/systems/session/lib/session-transcript-query.ts
  • web/src/systems/session/mocks/derive-fixtures.ts
  • web/src/systems/session/mocks/derive-handlers.ts
  • web/src/systems/session/mocks/runtime-fixture.ts
  • web/src/systems/settings/lib/__tests__/roles-config.test.ts
  • web/src/systems/settings/lib/roles-config.ts
  • web/src/systems/settings/mocks/roles-fixtures.ts

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


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 Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 1a32ba2.

…ting

Daemon tool-approval and workspace-consent prompts carry the Compozy session id; resolve them directly instead of through the agent-facing bound-session check. Also satisfy React Doctor (no try/finally in hooks, extract complex branches) and format site docs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[High risk] Session routing and continuation logic across agents and fallback chains.

The PR does not appear safe to merge while the previously reported cross-profile derivation access remains open.

Findings

  1. P1 Security Derivação ignora o perfil ▶
Summary

The PR adds session continuation and forking, fallback account routes, persisted derivation lineage, and CLI, API, native-tool, and web surfaces.

  • The changes since the previous review replace wrapped post-commit error text with a diagnostic or a plain message.
  • The earlier profile-authorization finding remains outstanding.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Client[CLI / Web / Native tool] --> Route[Continue / Fork / Preview]
  Route --> Manager[Session manager]
  Manager --> Receipt[Derivation receipt]
  Manager --> Source[Source transcript]
  Source --> Child[Derived session]
  Manager --> Error[Post-commit error payload]
Loading

Reviews (2) · Last reviewed commit: "fix: show the diagnostic message on post..."

// still returns its recorded outcome once the source was deleted. The child inherits
// the source's profile inside the manager.
func (h *BaseHandlers) deriveRoute(c *gin.Context) (workspaceScope, string, SessionDeriveManager, bool) {
scope, ok := h.resolveWorkspaceScope(c)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Derivação ignora o perfil

Quando alguém conhece o ID de uma sessão de outro perfil no mesmo workspace, Continue, Fork e Preview verificam apenas o workspace. Diferentemente da leitura normal de sessões, essas rotas não verificam o perfil da origem. Assim, o chamador pode obter a prévia ou criar uma sessão filha com o histórico do outro perfil. Verifique o perfil autorizado antes de ler a origem ou reutilizar um recibo de derivação.

How this was verified: Continue, Fork e Preview chegam à leitura da origem com apenas o ID do workspace, sem executar a verificação de perfil presente na leitura normal de sessões.

Knowledge Base Used:

Continue/Fork errors after the child is committed now carry the diagnostic's title and message (or a plain sentence) instead of the wrapped chain with agent stderr; the full chain stays in logs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 1a32ba25 Deployed Sep 29, 2026 by vercel[bot]
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.

1 participant