feat(minimald): rip out arbitrary session exec - #709
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughAdds an ChangesEcho task execution
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant SSHClient
participant handle_exec
participant TaskExec
participant task_producer
participant EchoProcess
SSHClient->>handle_exec: request min run task
handle_exec->>TaskExec: create task execution
TaskExec->>task_producer: produce task process
task_producer->>EchoProcess: interpolate echo task
EchoProcess-->>TaskExec: stdout and exit status
TaskExec-->>SSHClient: bridged execution result
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: 1
🤖 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/minimald/src/exec.rs`:
- Around line 810-817: Update the `argv.strip_prefix("min run ")` handling to
separate the task name from trailing arguments, using the first whitespace
delimiter so `task` contains only the name; alternatively, explicitly reject and
report extra arguments. Ensure lookup and subsequent execution use the parsed
task name, preserving the existing rejection path for malformed requests.
🪄 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: e12b0310-dc10-41db-8e2e-b56fcbd3d341
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
crates/mctx/src/env.rscrates/mctx/src/lib.rscrates/mfile/src/tasks.rscrates/minimald/src/exec.rscrates/minvmd/Cargo.tomlcrates/minvmd/tests/minimald_session_e2e.rs
| let task = match argv.strip_prefix("min run ") { | ||
| None => { | ||
| tracing::warn!(%session_id, "execution request rejected: expected `min run <task name>`"); | ||
| session.channel_failure(id)?; | ||
| return Ok(()); | ||
| } | ||
| Some(t) => t, | ||
| }.to_string(); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map relevant files and inspect the specific areas mentioned in the review comment.
git ls-files crates/minimald/src/exec.rs crates/minimald/src | sed -n '1,120p'
echo '--- outline exec.rs ---'
ast-grep outline crates/minimald/src/exec.rs --view expanded || true
echo '--- relevant lines around handle_exec ---'
sed -n '780,860p' crates/minimald/src/exec.rs
echo '--- search for split_once(" ") / run handler ---'
rg -n 'split_once\(" "\)|min run|TaskExec|task\(' crates/minimald/src -g'*.rs' -A4 -B4
echo '--- relevant surrounding lines in any matching file(s) ---'
# If rg found a run handler elsewhere, inspect the surrounding lines in that file by name.
fd -a 'exec.rs|*.rs' crates/minimald/src | sed -n '1,120p'Repository: gominimal/minimal
Length of output: 1994
Split task name from trailing args in min run — strip_prefix("min run ") currently treats the whole remainder as task, so min run mytask --flag looks up "mytask --flag" instead of "mytask". Split on the first space or reject extra args explicitly.
🤖 Prompt for 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.
In `@crates/minimald/src/exec.rs` around lines 810 - 817, Update the
`argv.strip_prefix("min run ")` handling to separate the task name from trailing
arguments, using the first whitespace delimiter so `task` contains only the
name; alternatively, explicitly reject and report extra arguments. Ensure lookup
and subsequent execution use the parsed task name, preserving the existing
rejection path for malformed requests.
1f51305 to
699f326
Compare
echoso we can tests tasks without needing the graph machinerySummary by CodeRabbit
echoactions with argument interpolation and newline-terminated stdout.min run <task>requests; other exec forms are rejected.