Skip to content

fix(session min): fix weird subcommands and messages, copypasta from tasks - #845

Merged
twitchyliquid64 merged 1 commit into
mainfrom
tom/session-inner
Jul 20, 2026
Merged

fix(session min): fix weird subcommands and messages, copypasta from tasks#845
twitchyliquid64 merged 1 commit into
mainfrom
tom/session-inner

Conversation

@twitchyliquid64

@twitchyliquid64 twitchyliquid64 commented Jul 20, 2026

Copy link
Copy Markdown
Member

Fixes: #839

Summary by CodeRabbit

  • New Features

    • Added support for installing packages at the session level.
    • Added the add-transient command for install-only package additions.
    • Updated min add to support session, build, and runtime package targets.
  • Bug Fixes

    • Session package changes are now saved and reloaded correctly.
  • Documentation

    • Simplified command usage and error messages for clearer guidance.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

AddDepMode::SessionPackages now persists session dependencies in minimal.toml. In-sandbox commands route session installs through this mode, transient installs through add-transient, and remove obsolete task-name handling. Helper usage and error messages no longer advertise --task.

Changes

Session package installation flow

Layer / File(s) Summary
Session dependency persistence
crates/mctx/src/lib.rs
Adds AddDepMode::SessionPackages, upserts [session].packages, reloads the context, and tests the resulting TOML.
Sandbox command routing
crates/minimald/src/env.rs
Routes add-session to session package persistence, introduces add-transient for install-only behavior, and removes task_name state.
Helper command surface
crates/mctx/src/min_helper.sh, crates/minimald/src/env_min_helper.sh
Removes --task from supported help and error text and simplifies unknown-command usage output.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant min
  participant SessionChannel
  participant PackageResolver
  participant Context
  participant minimal.toml
  min->>SessionChannel: add-session packages
  SessionChannel->>PackageResolver: resolve and install
  PackageResolver-->>SessionChannel: resolved packages
  SessionChannel->>Context: SessionPackages and package list
  Context->>minimal.toml: persist session.packages
Loading

Possibly related issues

Possibly related PRs

Suggested reviewers: norrietaylor

Poem

I hopped through the session, packages in tow,
Found a new place for dependencies to grow.
Task flags tucked away, transient paths made clear,
TOML gained a session table bright and dear.
A carrot for tests—then I disappear! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the subcommand and message changes, though it is a bit noisy.
Linked Issues check ✅ Passed The helper no longer advertises --task <taskname> and the routing matches the supported subcommands, satisfying #839.
Out of Scope Changes check ✅ Passed The changes stay focused on min helper behavior, RPC handling, and help text, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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/mctx/src/min_helper.sh`:
- Line 146: Remove the --task option from the min_helper.sh help synopsis for
min add. Keep the remaining --session, --build, and --runtime options and
package argument unchanged, matching the supported min add contract.

In `@crates/minimald/src/env_min_helper.sh`:
- Line 89: Update the fallback usage message in __min_add to remove the
unsupported --task option and list only the supported --session, --build, and
--runtime flags, matching the corrected usage text.

In `@crates/minimald/src/env.rs`:
- Around line 549-556: Update install and the add-build, add-runtime, and
add-session branches in handle so install reports success or failure; only
return the dependency tuple and allow ctx.add_deps/minimal.toml persistence when
installation succeeds, while preserving existing error output and parse-failure
behavior.
🪄 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: 93bd5720-4919-4e0a-87ee-6e8fe7239fa0

📥 Commits

Reviewing files that changed from the base of the PR and between b47efdb and 6fcf5ad.

📒 Files selected for processing (4)
  • crates/mctx/src/lib.rs
  • crates/mctx/src/min_helper.sh
  • crates/minimald/src/env.rs
  • crates/minimald/src/env_min_helper.sh

Comment thread crates/mctx/src/min_helper.sh
Comment thread crates/minimald/src/env_min_helper.sh
Comment thread crates/minimald/src/env.rs
@twitchyliquid64
twitchyliquid64 enabled auto-merge (squash) July 20, 2026 18:04
@twitchyliquid64
twitchyliquid64 merged commit 1a1bcfa into main Jul 20, 2026
28 checks passed
@twitchyliquid64
twitchyliquid64 deleted the tom/session-inner branch July 20, 2026 18:16
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.

in-sandbox min helper advertises --task <taskname> but always targets the current task

2 participants