Repository navigation
examples/multi-agent-notepad/demo.sh: --upload basename change leaves runner at wrong path #1147
Description
Agent Diagnostic
- Loaded
openshell-cliskill and read the demo end-to-end. - Ran
git logagainstcrates/openshell-cli/src/ssh.rsto find changes that affected--uploadsemantics. - Identified two PRs:
- fix(cli): preserve source directory on sandbox upload #952 (Apr 23) — non-filtered upload preserves source directory basename.
- fix(cli): preserve directory basename for filtered uploads #1028 (Apr 28) — filtered upload (the default
.gitignore-aware path) preserves it too.
- Confirmed
examples/multi-agent-notepad/demo.shwas authored Apr 27 (before fix(cli): preserve directory basename for filtered uploads #1028) and merged Apr 30 (after fix(cli): preserve directory basename for filtered uploads #1028). - Read
crates/openshell-cli/src/ssh.rs:686-722—directory_upload_prefixreturns the basename of the source directory; bothsandbox_sync_upandsandbox_sync_up_filesuse it, so the behavior is now consistent across--no-git-ignoreand the default path. - Confirmed by reading
examples/multi-agent-notepad/demo.sh:364(--upload "${PAYLOAD_DIR}:/sandbox") and:366(bash /sandbox/demo-runner.sh) that the runner is invoked at/sandbox/demo-runner.shbut is now uploaded to/sandbox/payload/demo-runner.sh. - Repro confirmed in a sibling demo (
examples/agent-driven-policy-management/demo.sh) that hit the same issue withbash: /sandbox/sandbox-agent.sh: No such file or directoryafter the upload reported success. - Other
--uploadcallers in the repo were checked (single-file callers inexamples/local-inference,examples/policy-advisor,e2e/policy-advisor, pluse2e/rust/tests/upload_create.rswhich already exercises the new semantics). The notepad demo is the only one that regressed.
Description
After #952 and #1028, --upload <local-dir>:<remote-dir> preserves the source directory's basename at the destination — --upload /tmp/.../payload:/sandbox now lands files at /sandbox/payload/... rather than flat at /sandbox/.... This is the documented intent (matches scp -r / cp -r).
examples/multi-agent-notepad/demo.sh was written against the pre-fix flat layout and references /sandbox/demo-runner.sh and /sandbox/prompts/.... With current main, the runner ends up at /sandbox/payload/demo-runner.sh, so the in-sandbox bash invocation fails with No such file or directory and the demo aborts before any worker runs.
Reproduction Steps
- Check out current
main. - With
gh auth login,codex login, anopenshell gateway startrunning, and a scratch GitHub repo, run:DEMO_GITHUB_OWNER=<your-handle> \ DEMO_GITHUB_REPO=<scratch-repo> \ DEMO_GITHUB_TOKEN="$(gh auth token)" \ bash examples/multi-agent-notepad/demo.sh
- Observe upload reports success but the worker fails with
bash: /sandbox/demo-runner.sh: No such file or directory.
Suggested fix
Switch the demo to the single-file --upload <file>:<dest> pattern that examples/agent-driven-policy-management/demo.sh and e2e/policy-advisor/test.sh already use:
--upload "${RUNNER_FILE}:/sandbox/demo-runner.sh" \
--upload "${PROMPTS_UPLOAD_DIR}/worker.md:/sandbox/prompts/worker.md" \
--upload "${PROMPTS_UPLOAD_DIR}/synthesis.md:/sandbox/prompts/synthesis.md" \(Or upload the directory and reference files at /sandbox/payload/...; either is fine, but the file-by-file pattern matches the rest of the repo.)
Five-line change. No design questions.
Environment
- OpenShell
mainpost-fix(cli): preserve directory basename for filtered uploads #1028 (any commit ≥20ffc725) - macOS or Linux host with Docker,
gh,codex, and a running OpenShell gateway
Logs
• Uploading files to /sandbox...
✓ Files uploaded
bash: /sandbox/demo-runner.sh: No such file or directory
Error: × ssh exited with status exit status: 127Note on root cause
Both #952 and #1028 are reasonable changes in isolation; the gap was that neither swept examples/ and e2e/ for --upload <dir>:<dir> callers and updated them. Worth flagging as a code-review norm for fix(cli) PRs that change argument semantics, and possibly worth a follow-up CI smoke that exercises each examples/*/demo.sh past env validation so this kind of drift is caught mechanically.
Agent-First Checklist
- I pointed my agent at the repo and had it investigate this issue
- I loaded relevant skills (
openshell-cli) - My agent could not resolve this — the diagnostic above explains why (out of scope for the branch I'm on; filing as follow-up so it doesn't get lost)
Activity