feat(commands): /loop /schedule /team-onboarding + expand /logout (#43 #58 #60 #63) - #88
Merged
Conversation
…sei#43 Crsei#58 Crsei#60 Crsei#63) Ship scheduling/automation and onboarding/logout groups as one change because they share infrastructure: - services/scheduler — JSON-backed recurring-task store with interval parsing, cross-process lockfile, and atomic writes. Used by both /loop (user-friendly wrapper, runs payload once immediately when it's a plain prompt) and /schedule (raw local-cron management; `remote` subcommand is explicitly refused until OAuth/remote-agent groundwork lands). - services/onboarding — shared onboarding state (`onboarding.json`) consumed by the expanded /logout reset flow and by /team-onboarding for tailored guide generation. - /logout — structured `LogoutReport` that clears credentials, resets onboarding (preserving display_name), and surfaces env overrides + managed-settings path without touching policy files. - /team-onboarding — Markdown guide grounded in real local state (CLAUDE.md, README.md, git origin/branch, skills registry, teams on disk, scheduled tasks). `save [path]` writes to a file. Tests: 21 scheduler + 4 onboarding + 9 loop + 10 schedule + 9 logout + 14 team-onboarding + registry assertions. Full non-UI suite passes serially (1253/1253); parallel-run failures are pre-existing flakes in unrelated modules. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
yaohaowei0914
pushed a commit
to yaohaowei0914/claude-code-rust
that referenced
this pull request
Apr 21, 2026
Integrates the fork-agent infrastructure and ancillary command/IPC updates that landed on rust-lite after this branch opened: - PR Crsei#85: fork-agent infra + /btw /simplify /advisor (Crsei#33 Crsei#37 Crsei#62) - PR Crsei#87: MCP/plugin/reload-plugins/ide/reload-plugins commands (Crsei#41 Crsei#44 Crsei#47 Crsei#49) - PR Crsei#88: /loop /schedule /team-onboarding (Crsei#43 Crsei#58 Crsei#60 Crsei#63) ## Conflict resolution Git's recursive merge handled every hunk on its own — each of the five files flagged as overlapping had non-overlapping line ranges between my workspace-split edits and rust-lite's feature edits: - `crates/cc-engine/src/types/app_state.rs` — my move to cc-engine vs. advisor/fork-related AppState fields. Clean auto-merge. - `crates/claude-code-rs/src/engine/agent/mod.rs` — my `cc_types::agent_*` import rewrites vs. rust-lite's `pub mod fork;` addition. Clean. - `crates/claude-code-rs/src/engine/lifecycle/deps.rs` — my `cc_types::background_agents` retyping and `hook_runner()` impl vs. rust-lite's `advisor_model` stripping logic. Clean. - `crates/claude-code-rs/src/query/deps.rs` — my `hook_runner()` / `drain_background_results` signature changes vs. rust-lite's new `ModelCallParams::advisor_model` field. Clean. - `crates/claude-code-rs/src/query/loop_impl.rs` — my hook-runner-trait rewiring vs. rust-lite's advisor model plumbing. Clean. All 40+ other touched files (api/*, commands/*, ide/*, ipc/*, services/*, etc.) merged without conflict — they're in regions my branch didn't touch. ## Verification - `cargo check --workspace`: clean (2 pre-existing warnings). - `cargo test -p cc-types`: 4/4 passing (teams + background_agents). - `cargo test -p cc-engine`: status_line + types suite unchanged. - `cargo test --bin claude-code-rs engine::agent query::loop_impl`: 69/69 passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Ships the scheduling/automation (
#58,#60) and onboarding/logout (#43,#63) groups as one change because they share infrastructure.services/scheduler— JSON-backed recurring-task store (interval parsing, cross-process lockfile, atomic writes). Shared by/loopand/schedule.services/onboarding— persistent first-run state consumed by both the expanded/logoutand/team-onboarding.What's in it
/loop— #58commands/loop_cmd.rs
/loop <interval> <payload>creates a recurring task; plain-prompt payloads returnCommandResult::Queryso they run once immediately (matching the Bun reference). Slash-command payloads are registered but not auto-dispatched (avoids re-entering/loop).list,remove,trigger,pause,resume,help.30s/5m/1h/2d/*/10 * * * *(full cron is future work; only the minute stride is honored today, with a clear error for anything richer)./schedule— #60commands/schedule.rs
add,list,show,remove,pause,resume,trigger,due./schedule remote …both explicitly flag the remote-triggers capability as separate and not yet implemented, keeping the two lines un-blurred per the issue's guidance./logout— #43commands/logout.rs
LogoutReport:credentials.jsoncleared (via existingauth::oauth_logout).update+reset_for_logout) sodisplay_name— a preference, not an identity artifact — survives.ANTHROPIC_API_KEY/ANTHROPIC_AUTH_TOKENenv overrides detected and surfaced as follow-up./team-onboarding— #63commands/team_onboarding.rs
CLAUDE.md,README.md, git origin/branch, skills registry, teams on disk, scheduled tasks, onboarding status./team-onboarding save [path]writes to a file (defaultONBOARDING_TEAM.md).CLAUDE.md, incomplete auth onboarding, first-run flag).Tests
/loop+ 10/schedule+ 9/logout+ 14/team-onboardinghandler testsloop,schedule+cron,team-onboarding+teamonboarding)teams::,commands::branch,tools::worktree, etc.) — verified by running them in isolation on both base and HEAD.Test plan
cargo build -p claude-code-rs— clean (only 2 pre-existing warnings inweb/handlers.rs)cargo test -p claude-code-rs --bin claude-code-rs services::schedulercargo test -p claude-code-rs --bin claude-code-rs services::onboardingcargo test -p claude-code-rs --bin claude-code-rs commands::loop_cmdcargo test -p claude-code-rs --bin claude-code-rs commands::schedulecargo test -p claude-code-rs --bin claude-code-rs commands::logoutcargo test -p claude-code-rs --bin claude-code-rs commands::team_onboardingcargo test -p claude-code-rs --bin claude-code-rs commands::tests(registry)cargo test -p claude-code-rs --bin claude-code-rs -- --test-threads=1(full suite serially)Reviewer notes
{data_root}/scheduled_tasks.json, guarded by a sibling.json.lockfile; onboarding state at{data_root}/onboarding.json. Both use atomic write-to-tmp + rename so crashes mid-write don't corrupt state.SchedulerKind::RemoteTriggeris reserved in the enum even though it's rejected at insert time today — this means on-disk state survives when the remote capability lands, without a breaking schema change./team-onboardingreads project state at invocation time; it never caches, so regenerating always reflects the current repo.🤖 Generated with Claude Code