Skip to content

feat(tui): add session picker for /resume + auto session titles#80

Merged
yishuiliunian merged 2 commits intomainfrom
feat/resume-session-picker
Apr 5, 2026
Merged

feat(tui): add session picker for /resume + auto session titles#80
yishuiliunian merged 2 commits intomainfrom
feat/resume-session-picker

Conversation

@yishuiliunian
Copy link
Copy Markdown
Contributor

Summary

  • /resume without args now opens an interactive TUI picker instead of printing a text list
  • Only root sessions shown (sub-agent sessions filtered via global exclusion set)
  • Session title auto-generated from first user message (truncated to 80 chars)

Changes

  • loopal-storage: list_root_sessions_for_cwd() scans all sessions to exclude sub-agent IDs; query methods split to session_query.rs
  • loopal-runtime: SessionManager exposes new query; ingest_message auto-sets title on first non-ephemeral message
  • loopal-tui: SubPage::SessionPicker + SubPageResult::SessionSelected; generic picker key handler extracted (handle_generic_picker_key); rewind picker split to sub_page_rewind.rs

Test plan

  • bazel build //... passes
  • bazel build //... --config=clippy zero warnings
  • bazel test //crates/loopal-storage:loopal-storage_test passes
  • bazel test //crates/loopal-runtime:loopal-runtime_test passes
  • CI passes

…te session titles (#79)

Replace the text-based session list with a TUI picker subpage when
/resume is invoked without arguments. Filter out sub-agent sessions
using a global exclusion set so only root sessions are shown. Auto-set
session title from the first user message to make the picker useful.

Refactor picker key handling: extract generic Esc/Up/Down/Char/Backspace
into handle_generic_picker_key to eliminate duplication between model and
session pickers. Split rewind picker and session query methods into
separate files to stay within the 200-line limit.
@yishuiliunian yishuiliunian merged commit c52b3d1 into main Apr 5, 2026
3 checks passed
@yishuiliunian yishuiliunian deleted the feat/resume-session-picker branch April 5, 2026 01:03
yishuiliunian added a commit that referenced this pull request Apr 5, 2026
…oval for path operations (#80)

Sandbox path violations (writes outside cwd, deny_write_globs, deny_read_globs) previously
returned hard errors that blocked operations even when the user had already approved the tool.
This prevented Loopal from performing legitimate ops tasks like editing /etc/nginx/nginx.conf.

Now these "soft denies" flow through the existing permission system:
- Bypass mode: auto-allows without prompting
- Supervised mode: asks the user with sandbox context
- Auto mode: routes to the LLM classifier

Hard denies remain for ReadOnly mode and path resolution failures (.. traversal, symlink escape).

Key changes:
- PathDecision simplified to three-state: Allow / Deny / RequiresApproval
- Backend gains approve_path() + check_sandbox_path() for session-scoped approval caching
- Runtime pre-checks extract paths from tool input before execution, elevating
  effective permission to Dangerous when sandbox approval is needed
- Execution-time fallback in resolve_checked() handles opaque tools (Bash/Glob/MCP)
- 35 new tests across backend, sandbox, and runtime layers
yishuiliunian added a commit that referenced this pull request Apr 5, 2026
…oval for path operations (#80) (#83)

Sandbox path violations (writes outside cwd, deny_write_globs, deny_read_globs) previously
returned hard errors that blocked operations even when the user had already approved the tool.
This prevented Loopal from performing legitimate ops tasks like editing /etc/nginx/nginx.conf.

Now these "soft denies" flow through the existing permission system:
- Bypass mode: auto-allows without prompting
- Supervised mode: asks the user with sandbox context
- Auto mode: routes to the LLM classifier

Hard denies remain for ReadOnly mode and path resolution failures (.. traversal, symlink escape).

Key changes:
- PathDecision simplified to three-state: Allow / Deny / RequiresApproval
- Backend gains approve_path() + check_sandbox_path() for session-scoped approval caching
- Runtime pre-checks extract paths from tool input before execution, elevating
  effective permission to Dangerous when sandbox approval is needed
- Execution-time fallback in resolve_checked() handles opaque tools (Bash/Glob/MCP)
- 35 new tests across backend, sandbox, and runtime layers
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