Skip to content

Refactor server lifecycle and RPC route contracts#223

Merged
Nek-12 merged 38 commits into
mainfrom
complete-server-split
May 9, 2026
Merged

Refactor server lifecycle and RPC route contracts#223
Nek-12 merged 38 commits into
mainfrom
complete-server-split

Conversation

@Nek-12

@Nek-12 Nek-12 commented May 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Collapse split local/remote lifecycle paths behind server-owned boundaries for prompt activity, user turns, queue/interrupt, launch/lifecycle/rollback, project binding/worktree target, auth/bootstrap/config, and runtime registration.
  • Add authoritative shared/rpccontract route metadata for RPC methods and derive gateway auth/handler exposure plus route coverage from it.
  • Add regression coverage for prompt subscribe gap, active-submit queue duplication, route/remote/loopback parity, and gateway route coverage.

Verification

  • ./scripts/test.sh ./...
  • ./scripts/build.sh --output ./bin/builder
  • Push hook: formatting, go vet, build, tests

Notes

  • docs/dev/techdebt/ is untracked local user work and intentionally not included.

Nek-12 added 30 commits May 7, 2026 22:17
Covers F0.1/F0.2, F2.1/F2.2/F2.3, F3.1, F4.1, and F6.1 slice 1A.

TUI runtime startup now requires shared runtime client, session activity stream, and prompt activity stream. Direct raw runtime event bridge, ask bridge, raw-engine runtime client helpers, and direct process manager fallback were removed from production CLI code; tests use loopback service adapters.
Covers F3.3 slice 2A.

Prompt activity now has sequence cursors, retained replay, gap errors, and a snapshot completion marker. TUI prompt recovery resubscribes through prompt activity only instead of reconciling via ask/approval view APIs.
Covers F4.3 first cut: runtime control now exposes SubmitUserTurn as canonical server command for pre-submit compaction, prompt history, primary-run gating, and final user-message submit. UI runtime client routes normal submits through it; legacy split RPCs remain until UI queue/pre-submit orchestration is migrated.
Covers F4.3: TUI no longer runs separate pre-submit check/compaction/prompt-history orchestration before submit. Normal user turns use the server-owned SubmitUserTurn boundary; UI queue/hydration tests now track active submit state only.
Covers F4.2. Replaces text-matched queued runtime discard with queue item ids and typed UI queue state.
Covers F4.4. Busy Ctrl+C now records interrupt intent; final interrupted activity and queue restoration come from server run-state completion.
Covers F5.3 and F5.4. Logout auth mutation now lives only in session lifecycle service; transition API uses typed serverapi action constants.
Covers F1.1. Server launch planner no longer owns picker/open-or-create behavior; CLI selection remains a view concern.
@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 157 files, which is 7 over the limit of 150.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c553474f-8ca4-48ec-8b56-42eac772c873

📥 Commits

Reviewing files that changed from the base of the PR and between 901fb5a and 7b7993d.

📒 Files selected for processing (157)
  • cli/app/ask_bridge_test.go
  • cli/app/auth_gate.go
  • cli/app/auth_gate_test.go
  • cli/app/embedded_server.go
  • cli/app/embedded_server_part2_test.go
  • cli/app/embedded_server_test.go
  • cli/app/launch_planner.go
  • cli/app/launch_planner_test.go
  • cli/app/project_binding_flow.go
  • cli/app/project_binding_flow_test.go
  • cli/app/prompt_events.go
  • cli/app/remote_auth_bootstrap.go
  • cli/app/remote_server.go
  • cli/app/run_prompt_target.go
  • cli/app/run_prompt_test.go
  • cli/app/runtime_event_bridge_test_helper_test.go
  • cli/app/runtime_factory.go
  • cli/app/runtime_factory_test.go
  • cli/app/runtime_factory_test_helpers_test.go
  • cli/app/runtime_projection_test.go
  • cli/app/session_lifecycle.go
  • cli/app/session_lifecycle_part2_test.go
  • cli/app/session_lifecycle_test.go
  • cli/app/session_server_target.go
  • cli/app/session_server_target_part2_test.go
  • cli/app/session_server_target_part3_test.go
  • cli/app/session_server_target_test.go
  • cli/app/stream_resubscribe_test.go
  • cli/app/terminal_bell.go
  • cli/app/terminal_bell_test.go
  • cli/app/ui.go
  • cli/app/ui_ask_controller.go
  • cli/app/ui_ask_deferred_test.go
  • cli/app/ui_busy_commands_test.go
  • cli/app/ui_clipboard_test.go
  • cli/app/ui_compaction_resume_test.go
  • cli/app/ui_event_reducers.go
  • cli/app/ui_input_controller.go
  • cli/app/ui_input_controller_commands.go
  • cli/app/ui_input_controller_flows.go
  • cli/app/ui_input_mode.go
  • cli/app/ui_input_mode_test.go
  • cli/app/ui_input_queue.go
  • cli/app/ui_input_resume.go
  • cli/app/ui_input_submission.go
  • cli/app/ui_layout_rendering.go
  • cli/app/ui_loop.go
  • cli/app/ui_native_scrollback_integration_part4_test.go
  • cli/app/ui_native_scrollback_integration_test.go
  • cli/app/ui_part2_test.go
  • cli/app/ui_part3_test.go
  • cli/app/ui_part4_test.go
  • cli/app/ui_part5_test.go
  • cli/app/ui_part6_test.go
  • cli/app/ui_part7_test.go
  • cli/app/ui_part8_test.go
  • cli/app/ui_part9_test.go
  • cli/app/ui_process_client.go
  • cli/app/ui_process_client_test.go
  • cli/app/ui_projected_test_helpers_test.go
  • cli/app/ui_queue_identity_test.go
  • cli/app/ui_rollback.go
  • cli/app/ui_runtime_adapter.go
  • cli/app/ui_runtime_adapter_part5_test.go
  • cli/app/ui_runtime_adapter_part6_test.go
  • cli/app/ui_runtime_adapter_test.go
  • cli/app/ui_runtime_client.go
  • cli/app/ui_runtime_client_part2_test.go
  • cli/app/ui_runtime_control.go
  • cli/app/ui_runtime_control_test.go
  • cli/app/ui_runtime_event_reduction.go
  • cli/app/ui_runtime_sync.go
  • cli/app/ui_scroll_keys_test.go
  • cli/app/ui_state.go
  • cli/app/ui_state_test_helpers_test.go
  • cli/app/ui_status.go
  • cli/app/ui_terminal_cursor_test.go
  • cli/app/ui_test.go
  • cli/app/ui_transcript_diag_test.go
  • cli/app/ui_transcript_entries.go
  • cli/app/ui_transcript_page_apply.go
  • cli/app/ui_transcript_pager.go
  • cli/app/ui_turn_completion_bell_test.go
  • cli/app/ui_worktree_commands.go
  • cli/app/ui_worktree_commands_part2_test.go
  • cli/app/ui_worktree_reducer.go
  • cli/builder/binding_commands_test.go
  • cli/tui/model.go
  • docs/dev/decisions.md
  • server/authbootstrap/service.go
  • server/authbootstrap/service_test.go
  • server/authstatus/service.go
  • server/authstatus/service_test.go
  • server/core/core.go
  • server/launch/planner.go
  • server/launch/planner_part2_test.go
  • server/launch/planner_test.go
  • server/lifecycle/lifecycle.go
  • server/lifecycle/lifecycle_test.go
  • server/primaryrun/runtime_client.go
  • server/primaryrun/runtime_client_test.go
  • server/projectview/service.go
  • server/projectview/service_test.go
  • server/promptactivity/service.go
  • server/registry/runtime_registry.go
  • server/registry/runtime_registry_test.go
  • server/runprompt/headless.go
  • server/runprompt/headless_test.go
  • server/runtime/chat_store.go
  • server/runtime/committed_transcript_events_test.go
  • server/runtime/engine.go
  • server/runtime/engine_part11_test.go
  • server/runtime/events.go
  • server/runtime/message_lifecycle.go
  • server/runtime/persisted_transcript_user_index.go
  • server/runtime/persisted_transcript_user_index_test.go
  • server/runtime/transcript_scan.go
  • server/runtimecontrol/service.go
  • server/runtimecontrol/service_idempotency_test.go
  • server/runtimecontrol/service_test.go
  • server/runtimecontrol/service_turn_submission.go
  • server/runtimeview/projection.go
  • server/runtimewire/runtime_registration.go
  • server/sessioncontrol/controller.go
  • server/sessioncontrol/controller_test.go
  • server/sessionlaunch/service.go
  • server/sessionlaunch/service_test.go
  • server/sessionlifecycle/service.go
  • server/sessionlifecycle/service_test.go
  • server/sessionruntime/service.go
  • server/transport/gateway.go
  • server/transport/gateway_contract_test.go
  • server/transport/gateway_part2_test.go
  • server/transport/gateway_test.go
  • shared/client/project_view.go
  • shared/client/remote.go
  • shared/client/remote_contract_test.go
  • shared/client/remote_stream.go
  • shared/client/remote_test.go
  • shared/client/runtime_control.go
  • shared/clientui/prompt.go
  • shared/clientui/runtime.go
  • shared/clientui/runtime_events.go
  • shared/clientui/runtime_events_test.go
  • shared/clientui/types.go
  • shared/protocol/handshake.go
  • shared/rollbacktarget/token.go
  • shared/rpccontract/routes.go
  • shared/rpccontract/routes_test.go
  • shared/serverapi/auth_bootstrap.go
  • shared/serverapi/auth_status.go
  • shared/serverapi/project_view.go
  • shared/serverapi/prompt_activity.go
  • shared/serverapi/runtime_control.go
  • shared/serverapi/session_launch.go
  • shared/serverapi/session_lifecycle.go
  • shared/transcript/entry_compare.go

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch complete-server-split

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@Nek-12 Nek-12 merged commit dacaa0e into main May 9, 2026
6 checks passed
@Nek-12 Nek-12 deleted the complete-server-split branch May 9, 2026 13:00
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