Skip to content

feat: session layouts, breadcrumb discovery, /wttab, pane titles/profiles#2

Open
AsafMah wants to merge 4 commits into
mainfrom
feat/layouts-discovery-tabs
Open

feat: session layouts, breadcrumb discovery, /wttab, pane titles/profiles#2
AsafMah wants to merge 4 commits into
mainfrom
feat/layouts-discovery-tabs

Conversation

@AsafMah

@AsafMah AsafMah commented Jun 22, 2026

Copy link
Copy Markdown
Owner

What

Builds on the merged WSL support (#1) with a layout primitive, plugin-agnostic
session discovery, the missing tab command, and richer single-pane options.

Commands & tools

  • /wttab [fork|current] — completes the set alongside /wtpane + /wtwindow.
  • /wtpane now accepts an optional [vertical|horizontal] split direction (was always auto).
  • spawn_session_pane — optional title / profile.
  • list_omp_sessions (new) — lists recent omp terminals, including ones this
    extension did not start
    , from oh-my-pi core's breadcrumb registry, newest first.
  • arrange_sessions (new) — opens several sessions as even columns or rows
    in one window, each resumed in its recorded working directory.

"Sessions not started by the plugin"

Discovery reads core's ~/.omp/agent/terminal-sessions/* breadcrumbs (cwd + session
file per terminal), which core writes for every terminal — so arranging/listing
works regardless of how a session was launched. A breadcrumb is a "last seen" marker,
not a liveness signal; the tools surface recency and warn that resuming a session
live elsewhere means two writers on one session file.

Internals

  • buildWtArgs emits -p / --title / -s via a shared paneTailArgs.
  • buildLayoutArgs — one chained wt argv (;-delimited) with an even-slice size
    formula; reuses the WSL adapter per pane (adaptLayoutPaneForHost).
  • discoverTerminalSessions honors PI_CODING_AGENT_DIR / PI_CONFIG_DIR / profile.
  • OMP_BIN now supports multi-token commands.

Docs & CI

  • README: new tools/commands, an "Arranging & discovering sessions" section, config.
  • Skill routes common cases to arrange_sessions / list_omp_sessions, keeps raw
    wt.exe for bespoke grids/focus moves.
  • Adds GitHub Actions CI (bun test + tsc).

Verification

  • bun test24 pass / 0 fail; tsc --noEmit clean.
  • New tests: buildWtArgs title/profile/size, buildLayoutArgs (order, -V/-H,
    ; delimiters, even-slice sizes, single-pane, empty-throws), adaptLayoutPaneForHost
    (WSL wrap + native identity), discoverTerminalSessions (newest-first, current flag,
    malformed-skip, missing-dir) — env restored in afterEach.
  • E2E: the real buildLayoutArgs output, run through cmd.exe /d /s /c wt.exe,
    opened a 3-pane -s-sized titled layout — all three panes' marker files were written,
    confirming the ;-chain splits and per-pane commands execute through the actual launcher.

Notes

  • The layout primitive intentionally ships columns/rows only (robust, ordered, even,
    fully tested). Arbitrary grids via chained sp/mf are fragile to verify and remain
    the skill's domain.

AsafMah added 4 commits June 22, 2026 14:49
…iles

Adds a tested multi-pane layout primitive, plugin-agnostic session
discovery, completes the command set, and enriches single-pane options.

Commands & tools
- /wttab: open the session in a new tab (completes /wtpane + /wtwindow).
- /wtpane now accepts an optional [vertical|horizontal] split direction.
- spawn_session_pane: optional title/profile.
- list_omp_sessions (new): list recent omp terminals — including ones this
  extension did not start — from core's breadcrumb registry, newest first.
- arrange_sessions (new): open several sessions as even columns/rows in one
  window, each resumed in its recorded cwd.

Internals
- buildWtArgs emits -p/--title/-s; shared paneTailArgs helper.
- buildLayoutArgs: one chained `wt` argv (`;`-delimited) with an even-slice
  size formula; reuses the WSL adapter per pane (adaptLayoutPaneForHost).
- discoverTerminalSessions reads <agent>/terminal-sessions/* (cwd + session
  file per terminal); honors PI_CODING_AGENT_DIR / PI_CONFIG_DIR / profile.
- OMP_BIN now supports multi-token commands (ompLauncher).

Verification
- bun test (24 pass) + tsc clean.
- E2E: real buildLayoutArgs output through cmd.exe/wt.exe opened a 3-pane,
  -s-sized, titled layout (marker files confirmed all panes ran).

Docs
- README: new tools/commands, an "Arranging & discovering sessions" section,
  OMP_BIN/PI_CODING_AGENT_DIR config.
- Skill routes common cases to arrange_sessions/list_omp_sessions, keeps raw
  wt.exe for bespoke layouts.
- Add GitHub Actions CI (bun test + tsc).
Move the extension's development knowledge into the plugin itself (a skill,
like the bundled windows-terminal-control), so it's versioned with the code
and surfaced to agents working in this repo rather than living only in a
local managed skill.

- skills/windows-terminal-dev/SKILL.md: type-only host API, bun test + tsc
  gates, wt.exe-via-cmd.exe + the `;` argv-quoting verification technique,
  even-split layout math, breadcrumb session discovery, push/CI notes.
- README "Develop": point contributors at it.
Source review of pi-coding-agent SessionManager#rememberBreadcrumb +
pi-tui ttyid.getTerminalId showed core writes a breadcrumb only for a
persisted session in an *identifiable* terminal — on Windows that's
Windows Terminal (WT_SESSION) or a tmux/zellij/kitty/wezterm multiplexer;
a plain cmd/PowerShell/conhost console sets no WT_SESSION and leaves none.
/tan named forks are suppressed, and only the latest session per terminal
is kept. The plugin-vs-not axis was never the boundary (both get
breadcrumbs equally) — terminal-identifiability + persistence is.

Tighten the overstated "for EVERY terminal" wording in the
discoverTerminalSessions docstring, the list_omp_sessions tool
description, the README discovery section, and the windows-terminal-dev
skill to state the verified coverage boundary.
…ion store

Closes the discovery gap for sessions with no breadcrumb (plain console,
non-interactive, older-than-latest). On this machine the store holds 105
sessions vs 83 breadcrumbs — 56 of them breadcrumb-less, i.e. invisible to
breadcrumb-only discovery.

- scanStoredSessions(): walks <agent>/sessions/<project>/*.jsonl and recovers
  { id, cwd, title } from each file's first-line header, reading only a bounded
  16KB slice (never whole files), newest-first by mtime.
- list_omp_sessions gains `source: "breadcrumbs" | "all"` (default unchanged).
  "all" lists every persisted session with its recorded cwd/title, marking the
  current one via ctx.sessionManager.getSessionFile().
- arrange_sessions resolves explicit `sessions` refs against the store too, so a
  breadcrumb-less session still arranges in its recorded directory.
- Tests (27 pass): header recovery + newest-first across projects, non-jsonl /
  missing-cwd skip, absent-store empty; env restored in afterEach.
- README + windows-terminal-dev skill document the opt-in store scan.
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