chore(sessions): don't compose lifecycle hooks until we finish implementing them - #975
Conversation
📝 WalkthroughWalkthroughLifecycle hooks are cleared from minimal loadout contributions, excluded from related counts and runtime logging, and covered by a composition test. Documentation clarifies downstream gating, while the example upstream configuration moves to a new branch and commit. ChangesLifecycle hook suppression
Example upstream fixture update
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/minimal/src/loadouts.rs`:
- Around line 106-113: Update the loadout preparation flow before
UserComposer.compose (and its underlying add_all) so lifecycle hooks are removed
or excluded before composition, rather than clearing wire.lifecycle_hooks
afterward. Ensure invalid or duplicate hooks cannot trigger validation or
conflicts, and add coverage confirming they do not affect an otherwise valid
loadout.
In `@crates/minimald/src/session_host.rs`:
- Around line 244-247: Update the comment near the disabled session transition
script logic to state that declared project hooks are accepted and composed but
currently suppressed or omitted from emitted output, rather than refused at
compose time. Preserve the note that the content-logging loop should be restored
when the feature ships.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fb8909ae-df5c-4cd7-8956-05fd8854f12e
📒 Files selected for processing (5)
crates/mfile/src/project_composable.rscrates/minimal/src/loadouts.rscrates/minimald/src/session_host.rscrates/sessions/example_project/minimal.tomlcrates/sessions/src/daemon/composer.rs
💤 Files with no reviewable changes (1)
- crates/sessions/src/daemon/composer.rs
ae34bff to
26cd1d2
Compare
- mention detach in the intro - introduce loadouts in 'Why sessions' as the personal-tooling vector - note loadouts contribute to the shell, never to tasks - make session-vs-sandbox terminology consistent (session = durable environment; sandbox = execution context) - describe current networking caveats: own-ip unavailable on the native Linux provider, macOS host-net outbound-only - correct the lifecycle-hooks status after #975: project hooks composed but never executed, loadout hooks excluded from composition - platform-neutral wording for min stop Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per review: flag the feature up front instead of the stale trailing note. After #975 loadout-declared hooks are excluded from composition entirely, so the old 'composed and recorded' wording was wrong too. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs(concepts): add the loadouts concept guide * docs(sessions): de-emphasize mip in loadouts session boundary Loadouts are a session-plane feature, and tasks run through both `min run` and `mip run`, so naming only `mip` as the task runner over-attributed task execution to the advanced build CLI. Drop the `mip` naming and keep the accurate loadouts-apply-to-sessions-not- task-sandboxes contrast. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(concepts): loadout accuracy fixes from agent-test review Note that hook execution is not yet wired up, state that conflicting values fail activation, show the default-loadout legend line in the ls sample, and use bare home-relative patch dests to match the reference schema. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(concepts): mark loadout lifecycle hooks as coming soon Per review: flag the feature up front instead of the stale trailing note. After #975 loadout-declared hooks are excluded from composition entirely, so the old 'composed and recorded' wording was wrong too. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs(concepts): add the sessions concept guide Author a user-facing concept guide for Minimal sessions: what a session is and why, the provider/session model, creating and entering one, composition from project config plus loadouts, lifecycle, and how sessions relate to sandboxes and tasks. Grounded in the min CLI surface and the architecture docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(concepts): correct session exec, sync, and lifecycle semantics The command channel accepts only min run invocations, project files are an uploaded workspace copy (git push min:// brings changes back), lifecycle hook execution is not yet wired, provider stop keeps session records, and the sandbox persists across detach. Also covers detach explicitly and drops the redundant trailing path from the activate example, per review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(concepts): address review on the sessions guide - mention detach in the intro - introduce loadouts in 'Why sessions' as the personal-tooling vector - note loadouts contribute to the shell, never to tasks - make session-vs-sandbox terminology consistent (session = durable environment; sandbox = execution context) - describe current networking caveats: own-ip unavailable on the native Linux provider, macOS host-net outbound-only - correct the lifecycle-hooks status after #975: project hooks composed but never executed, loadout hooks excluded from composition - platform-neutral wording for min stop Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Lifecycle hooks won't be ready for open source launch, so for now we won't compose them in and won't print any output about them.
Testing
Activated a session with a loadout that had a lifecycle hook defined and verified that there were no log messages about it
Note
Gate lifecycle hooks out of session composition before full implementation
Loadout::without_lifecycle_hooksin loadout.rs to strip lifecycle hooks from a loadout, used as a feature gate until hooks are fully implemented.compose_user_contributionin loadouts.rs now drops lifecycle hooks from user loadouts before building theUserComposer, so no hooks appear in the resultingWireContribution.Macroscope summarized 26cd1d2.
Summary by CodeRabbit
Loadouthelper to remove lifecycle hooks before composing.unstablewith a new locked revision.