Skip to content

feat(cli/tui): cloud session selection and cloud-mode feature gating#507

Open
theahura wants to merge 11 commits into
mainfrom
auto/implement-application-specification-f-20260608-163440
Open

feat(cli/tui): cloud session selection and cloud-mode feature gating#507
theahura wants to merge 11 commits into
mainfrom
auto/implement-application-specification-f-20260608-163440

Conversation

@theahura

@theahura theahura commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

🤖 Generated with Nori

Cloud Session Selection (Spec Item 1)

  • Add session listing and resumption to nori cloud — users now see previous sessions and can resume one or start new, instead of always creating a new session
  • Add BrokerClient::list_sessions() (GET /api/sessions) and BrokerClient::resume_session() (POST /api/sessions/{id}/resume) with CloudSessionSummary type
  • Create cli/src/cloud.rs with pre-TUI session picker (format, parse, prompt via stdin/stderr)
  • Graceful fallback: broker 404 or errors fall back to new-session-only; non-interactive terminals skip the picker entirely

Cloud-Mode Feature Gating (Spec Item 2)

  • Disable 11 client-only slash commands in cloud mode (/settings, /init, /browse, /diff, /mention, /memory, /mcp, /browser, /switch-skillset, /resume, /resume-viewonly) using the existing CommandAvailability/disabled_builtins infrastructure
  • Skip auto-worktree setup and skillset-per-session deferred spawning when cloud_connection.is_some()
  • Re-apply cloud restrictions after SessionCapabilitiesChanged to prevent backend capability updates from accidentally re-enabling client-only commands

Test Plan

  • 9 integration tests for broker list_sessions and resume_session methods
  • 8 unit tests for session list formatting and input parsing
  • 2 unit tests for SlashCommand::available_in_cloud_mode() classification
  • Full TUI test suite passes (cargo test -p nori-tui)
  • CLI test suite passes (cargo test -p nori-cli)
  • E2E tests pass (cargo test -p tui-pty-e2e)
  • Clippy clean
  • Manual verification: run nori cloud and confirm disabled commands are greyed out
  • Broker-side PR needed: GET /api/sessions and POST /api/sessions/{id}/resume endpoints in nori-sessions

Share Nori with your team: https://www.npmjs.com/package/nori-skillsets

theahura and others added 3 commits June 8, 2026 12:35
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
When running `nori cloud` in an interactive terminal, the CLI now lists
existing cloud sessions and lets the user pick one to resume or start a
new one, instead of always creating a new session.

Changes:
- Add CloudSessionSummary type and list_sessions/resume_session methods
  to BrokerClient (calls GET /api/sessions and POST /api/sessions/{id}/resume)
- Add new BrokerError variants: ListFailed, ResumeFailed
- Create cli/src/cloud.rs with session picker UI (format, parse, prompt)
- Modify cloud subcommand handler to show picker before TUI launch
- Graceful fallback: 404 or errors from list_sessions → new session only
- Non-interactive terminals skip picker (preserves scriptability)
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
When the TUI runs in cloud mode (via `nori cloud`), client-side-only
slash commands are now disabled. 11 commands that require local
filesystem, config, or process access are greyed out in the command
popup and blocked at dispatch: /settings, /init, /browse, /diff,
/mention, /memory, /mcp, /browser, /switch-skillset, /resume, and
/resume-viewonly.

Uses the existing CommandAvailability/disabled_builtins infrastructure.
Also skips auto-worktree setup and skillset-per-session deferred
spawning in cloud mode.
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
@theahura theahura changed the title feat(cli): add session selection to nori cloud command feat(cli/tui): cloud session selection and cloud-mode feature gating Jun 8, 2026
theahura and others added 8 commits June 8, 2026 15:38
- Fix CURRENT-PROGRESS.md: remove /resume from cloud-enabled list (it's
  actually disabled), correct description of capability re-application
- Fix RESEARCH-NOTES.md: move /resume and /resume-viewonly to disabled
  section with explanation (local transcripts don't exist in cloud)
- Fix tui/docs.md: make cloud-disabled list less brittle, include
  /resume and /resume-viewonly
- Mark all CLI-side spec items as complete
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
Use whole-object assertions in broker happy-path tests per project
convention, add completeness check for cloud mode classification,
and add negative number edge case for session choice parsing.
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
…ation-specification-f-20260608-163440

# Conflicts:
#	nori-rs/acp/src/broker/docs.md
#	nori-rs/cli/docs.md
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
…ogical test

- Add BrokerError::InvalidResponse for malformed broker response bodies
  (previously misused InvalidToken which confused error semantics)
- Remove cloud_mode_tests_cover_all_variants which was a tautology that
  could never fail (exhaustive match already enforces coverage at compile time)
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
Add missing broker test cases (locally-expired JWT and malformed
response for list_sessions/resume_session), improve assertion quality
(full struct assert, exact URL matching), show last_active_at timestamp
in session picker, and add variant count guard to cloud mode tests.

🤖 Generated with [Nori](https://noriagentic.com)
…aversal

Session IDs from the broker response are untrusted input. Without
validation, a malformed ID containing '/' or '..' could construct
a URL targeting an unintended endpoint. Add validate_session_id()
that restricts IDs to alphanumeric, hyphen, and underscore characters.

Also removes a tautological test (cloud_mode_tests_cover_all_variants)
that could never fail — the exhaustive match already provides
compile-time coverage.
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
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.

1 participant