Skip to content

feat(ui): surface --dir / pinned workspace for first-time users#389

Merged
esengine merged 1 commit intomainfrom
feat/370-cross-folder-discoverability
May 7, 2026
Merged

feat(ui): surface --dir / pinned workspace for first-time users#389
esengine merged 1 commit intomainfrom
feat/370-cross-folder-discoverability

Conversation

@esengine
Copy link
Copy Markdown
Owner

@esengine esengine commented May 7, 2026

Closes #370.

Why

Beginners hit the default cwd-scoped behavior and conclude Reasonix can't read folders other than where they launched it. reasonix code --dir <path> exists today and works fine — it's just invisible until you --help. (The issue body suggested /cwd exists; it doesn't, and the agent's system prompt explicitly says mid-session retargeting was removed because the message log + memory paths get tangled with a stale root.)

So this is purely an onboarding fix — no new capability, no /cwd slash.

Surfaces added

  1. WelcomeBanner — shows a workspace line in code mode on the empty state:

    ▸ workspace · /path/to/repo  (relaunch with --dir <path> to switch)
    
  2. /status — adds a workspace line:

    workspace /path/to/repo · pinned at launch (relaunch with --dir <path> to switch)
    
  3. Filesystem sandbox-escape error — was a raw path escapes sandbox root (X): Y; now points the user at the right fix:

    path escapes sandbox root (X): Y — workspace is pinned at launch; quit and relaunch with reasonix code --dir <path> to work in a different folder

  4. README + README.zh-CN — Getting Started subsection explaining --dir and why mid-session switching isn't a thing.

Tests

No new test file — all four surfaces are static text additions. Existing tests cover the unchanged code paths:

  • tests/filesystem-tools.test.ts — still asserts /escapes sandbox/ (matches the new message prefix).
  • tests/slash.test.ts — unaffected (workspace line only appears in /status when ctx.codeRoot is set).

Test plan

  • npm run verify — 134 files / 2152 passed / 1 skipped
  • Manual: reasonix code empty-state shows the workspace banner line
  • Manual: /status shows the workspace line in code mode
  • Manual: ask the model to read a path outside rootDir → tool error mentions reasonix code --dir

User feedback (multiple data points): beginners hit the default
cwd-scoped behavior and conclude Reasonix can't read folders other
than where they launched it. The capability already exists via
`reasonix code --dir <path>`, but nothing in the UI tells you so
until you read --help.

Three onboarding surfaces now make it discoverable:

- WelcomeBanner shows a "▸ workspace · /path  (relaunch with --dir
  <path> to switch)" line in code mode. Visible only on the empty
  state, so it doesn't survive past the first turn.

- `/status` includes a workspace line:
    workspace /path · pinned at launch (relaunch with --dir <path>
    to switch)

- The filesystem sandbox-escape error now points the user at --dir
  instead of just dropping a raw "path escapes sandbox root":
    path escapes sandbox root (X): Y — workspace is pinned at
    launch; quit and relaunch with `reasonix code --dir <path>` to
    work in a different folder

Plus a Getting Started callout in both READMEs explaining --dir and
why mid-session switching isn't a thing (message log + memory paths
get tangled with stale roots, so the design pins at launch).

No new slash command, no /cwd. The agent's system prompt already
says mid-session switching was removed by design.
@esengine esengine merged commit d0b251d into main May 7, 2026
3 checks passed
@esengine esengine deleted the feat/370-cross-folder-discoverability branch May 7, 2026 15:37
@esengine esengine mentioned this pull request May 7, 2026
6 tasks
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.

Cross-folder access (--dir / /cwd) not discoverable for beginners

1 participant