Repository navigation
refactor(server): split server.rs into concern modules - #136
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Stephen Belanger (Qard)
force-pushed
the
refactor/split-lib
branch
from
October 6, 2026 13:24
7a7d56e to
a996463
Compare
Stephen Belanger (Qard)
force-pushed
the
refactor/split-server
branch
from
October 6, 2026 13:24
eec2bf7 to
20d2381
Compare
Abhijeet Prasad (AbhiPrasad)
approved these changes
Oct 6, 2026
server.rs was about 2,700 lines of daemon state plus every subsystem that operates on it. The Daemon struct, options, startup and the serve entry points stay in server/mod.rs. Each subsystem moves to its own module, contributing its own `impl Daemon` block: - auth: route auth resolution, refresh before flush, diagnosis - sessions: delivery keys, session actors, journal writers, locks - ingress: the capture queue, its worker and overflow recovery - correlation_store: automatic parent correlation and its persisted state - recovery: startup replay of unfinished journals - rpc: listener, request handling, status - maintenance: GC, idle retirement, the idle watchdog, shutdown drain - managed_run: managed-run session tracking and flushing - claude_transcripts: Claude Code's transcript poller, now isolated from the generic daemon code Code moves verbatim apart from `pub(super)` visibility. Submodules share the parent's imports through `use super::*`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Stephen Belanger (Qard)
force-pushed
the
refactor/split-server
branch
from
October 6, 2026 14:04
20d2381 to
3e929a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Based on
mainnow that #135 has merged.server.rsheld about 2,700 lines: theDaemonstruct and every subsystem that operates on it. The struct,ServeOptions, the auth traits,runand the serve entry points stay inserver/mod.rs(344 lines). Each subsystem moves to its own module with its ownimpl Daemonblock:auth.rsauth.diagnosesessions.rsDeliveryKey, session actors, journal writers, per-session locks, retirementingress.rscorrelation_store.rsrecovery.rsrpc.rsstatusmaintenance.rsmanaged_run.rsclaude_transcripts.rsBehaviour
None. The code moves verbatim:
pub(super).pub(super).I checked this mechanically: with
pub(super)stripped, the line multisets of the old and new files differ only by those re-wrapped signatures, the new module docs, and theuse super::*/impl Daemon {lines.Submodules share the parent's imports through
use super::*, andmod.rsglob-imports each submodule. This keeps the PR a pure move. Tightening those imports can come later, once later PRs have moved the per-agent special cases out of the daemon.The lock-ordering comments stay attached to the code they describe.
Testing
cargo clippy --all-features --all-targets -D warningsis clean.cargo test --all-features --no-fail-fast: everything passes excepttrace_runtime::tests::doctor_reports_a_daemon_that_{cannot_authenticate_the_route,resolves_other_credentials}, which fail the same way onmainin my local environment.Conflicts
#132 and #130 both edit
server.rs. Whichever lands second needs a rebase. Hunks in those PRs map onto the table above.🤖 Generated with Claude Code