Context
A trusted code session in tyrode-infra persisted successfully under ~/.omp/agent/sessions, but a separate top-level OMP process could not resolve it through history://. This is not proof of lost state: history:// is a live harness-roster lookup, not a filesystem session index.
Persisted OMP sessions currently span several state models:
- trusted/generated
code launches force OMP profile default;
- the wrapper's UUID shim scans default and named-profile roots only when no explicit state selector is present;
- explicit
OMP_PROFILE, PI_CODING_AGENT_DIR, PI_CONFIG_DIR, --profile, or --session-dir bypass that scan;
- generated one-shot
--config overlays should not change session-root identity;
- untrusted sessions are intentionally isolated and refuse resume flags;
history:// only knows agents registered to the current live harness session.
The result is both a discovery problem and a weak resume experience: a persisted session can appear hidden, and code cannot yet prioritize sessions belonging to the repository where it was opened.
Goal
Give code one deterministic, metadata-only, repository-aware way to discover and resume trusted sessions across every managed state root, while clearly separating persisted OMP sessions from live history:// agents.
The TUI should make history available without permanently consuming generator space, support direct resume and resume-with-customization, and keep the selected launch target unambiguous until launch or explicit clearing.
Related tracking
Scope
1. One trusted state-root resolver
Reuse one resolver for code discovery/launches and the omp resume shim.
- Search the default root, named profiles, and supported explicit session directories selectable by
code.
- Resolve a full ID or prefix to exactly one
(canonical trusted state root, full session ID) tuple before launch.
- Preserve deterministic ambiguity protection across roots.
- When a session is outside the active root, select that root explicitly or show the exact safe resume command.
- Keep
ompu state outside all trusted discovery and clearly report that untrusted sessions are intentionally non-resumable.
2. Metadata-only repository-aware discovery
Read only an explicit metadata allowlist:
- session title;
- full session ID;
- recorded canonical cwd;
- repository/worktree identity when determinable;
- profile/state root;
- creation time and last activity.
Do not inspect prompts, messages, tool output, transcript bodies, or credentials to summarize a session.
Rank results deterministically:
- exact current-directory match;
- same Git repository/worktree;
- recorded cwd in a parent/child relationship;
- sessions elsewhere by last activity.
The default history view prioritizes the current repository, with an explicit route to all trusted sessions. Missing/deleted cwd values, symlinks, and linked worktrees must degrade safely.
3. Collapsible history rail
History is collapsed by default on the left of the code TUI and reserves no unexplained empty pane width while collapsed.
When expanded:
- a keyboard-navigable session list appears on the left;
- focused-row changes update an adjacent compact, read-only settings inspection;
- pointer hover may mirror focus where supported, but every action and setting remains fully keyboard accessible;
- the normal editable generator becomes a compact selected session settings view showing only values recorded or safely known for the focused session, rather than every available generator option;
- unavailable historical values are labeled unknown rather than inferred from transcript content;
- the compact inspection should let the history rail remain useful without forcing the full generator to retain its normal width;
- narrow terminals use a drawer/full-screen history composition rather than crushing history, generator, routing, usage, or help into unreadable columns.
Focusing or hovering a row is inspection only. It must never launch that session and must not silently replace an already selected pending resume target.
4. Explicit resume target and customization flow
The history surface provides two intentional paths:
- resume a resolved session with the current compatible setup; or
- choose resume, customize profile first through a discoverable keyboard action.
Customization must:
- explicitly select the resolved session as the pending resume target;
- collapse history again;
- restore the generator's normal editable profile/facet controls;
- retain the selected session until the user explicitly clears or replaces it;
- show a persistent resume summary next to the generator launch action, including title and an unambiguous ID suffix;
- change the final action language from
Launch new to Resume <title> · <ID>;
- never treat focusing/hovering another history row as target replacement;
- provide a clear action that returns to a new-session launch.
The launch target is model state, not a visual side effect. Resize, usage refresh, vault-manager entry, routing collapse, and generator edits must not clear or replace it.
5. Current versus recorded settings
This issue owns discovery and resume with current setup. OMP remains responsible for replaying its own session state.
Recorded code launch settings are a separate contract owned by #6. Until a valid root-scoped receipt exists:
- show only safely available metadata;
- do not reconstruct generated routing by scanning transcript bodies;
- do not claim that the original vault or generator profile is known;
- keep current selected vault and current Nix-managed policy as the default resume setup.
Resume with current setup and resume, customize profile first have different model precedence. Pinned OMP v17 intentionally restores the session's last active model and thinking state when no explicit model is supplied; a generated one-shot config changing the default role is not itself an explicit model override. Therefore:
- direct resume with no model/profile customization preserves the session-owned active model and thinking state when compatible;
- choosing
resume, customize profile first and selecting a generator profile/default model is explicit user intent, so that selected model must win instead of being silently replaced by the session's previous model;
- an explicit forwarded
code --resume <ID> --model <MODEL> override must also win;
- if the chosen vault cannot authenticate the restored or selected model, stop with an actionable choice rather than silently switching model or identity.
This is a launcher precedence/UX contract, not evidence that OMP replay is corrupt: #6 owns the launch-recipe and argv implementation details.
A future receipt lookup must happen only after this issue resolves the exact (canonical trusted state root, full session ID) tuple; an ID prefix alone can never select a receipt.
6. Documentation
Explain the difference between:
Delivery plan and progress
Phase 1 — resolver and metadata
Phase 2 — history TUI
Phase 3 — resume target state
Phase 4 — integration and documentation
Acceptance criteria
Likely ownership
pkgs/code-tui/
pkgs/omp-configured/default.nix
pkgs/omp-configured/README.md
pkgs/cli-kit/ only where an existing generic responsive/navigation primitive is genuinely reusable
Context
A trusted
codesession intyrode-infrapersisted successfully under~/.omp/agent/sessions, but a separate top-level OMP process could not resolve it throughhistory://. This is not proof of lost state:history://is a live harness-roster lookup, not a filesystem session index.Persisted OMP sessions currently span several state models:
codelaunches force OMP profiledefault;OMP_PROFILE,PI_CODING_AGENT_DIR,PI_CONFIG_DIR,--profile, or--session-dirbypass that scan;--configoverlays should not change session-root identity;history://only knows agents registered to the current live harness session.The result is both a discovery problem and a weak resume experience: a persisted session can appear hidden, and
codecannot yet prioritize sessions belonging to the repository where it was opened.Goal
Give
codeone deterministic, metadata-only, repository-aware way to discover and resume trusted sessions across every managed state root, while clearly separating persisted OMP sessions from livehistory://agents.The TUI should make history available without permanently consuming generator space, support direct resume and resume-with-customization, and keep the selected launch target unambiguous until launch or explicit clearing.
Related tracking
Scope
1. One trusted state-root resolver
Reuse one resolver for
codediscovery/launches and theompresume shim.code.(canonical trusted state root, full session ID)tuple before launch.ompustate outside all trusted discovery and clearly report that untrusted sessions are intentionally non-resumable.2. Metadata-only repository-aware discovery
Read only an explicit metadata allowlist:
Do not inspect prompts, messages, tool output, transcript bodies, or credentials to summarize a session.
Rank results deterministically:
The default history view prioritizes the current repository, with an explicit route to all trusted sessions. Missing/deleted cwd values, symlinks, and linked worktrees must degrade safely.
3. Collapsible history rail
History is collapsed by default on the left of the
codeTUI and reserves no unexplained empty pane width while collapsed.When expanded:
Focusing or hovering a row is inspection only. It must never launch that session and must not silently replace an already selected pending resume target.
4. Explicit resume target and customization flow
The history surface provides two intentional paths:
Customization must:
Launch newtoResume <title> · <ID>;The launch target is model state, not a visual side effect. Resize, usage refresh, vault-manager entry, routing collapse, and generator edits must not clear or replace it.
5. Current versus recorded settings
This issue owns discovery and resume with current setup. OMP remains responsible for replaying its own session state.
Recorded
codelaunch settings are a separate contract owned by #6. Until a valid root-scoped receipt exists:Resume with current setupandresume, customize profile firsthave different model precedence. Pinned OMP v17 intentionally restores the session's last active model and thinking state when no explicit model is supplied; a generated one-shot config changing the default role is not itself an explicit model override. Therefore:resume, customize profile firstand selecting a generator profile/default model is explicit user intent, so that selected model must win instead of being silently replaced by the session's previous model;code --resume <ID> --model <MODEL>override must also win;This is a launcher precedence/UX contract, not evidence that OMP replay is corrupt: #6 owns the launch-recipe and argv implementation details.
A future receipt lookup must happen only after this issue resolves the exact
(canonical trusted state root, full session ID)tuple; an ID prefix alone can never select a receipt.6. Documentation
Explain the difference between:
history://agents;codelaunch setup;Delivery plan and progress
Phase 1 — resolver and metadata
Phase 2 — history TUI
Phase 3 — resume target state
resume, customize profile firstkeyboard action.Phase 4 — integration and documentation
codeand theompUUID shim through the shared resolver contract.history://, and receipt boundaries.Acceptance criteria
codeis discoverable and resumable by documented ID.codein a repository prioritizes exact-directory and same-repository sessions.--configoverlays do not change session-root identity.--modelwins during resume, and incompatible vault/model combinations fail with an actionable choice rather than a silent identity or model switch.Launch newfromResume <title> · <ID>.history://agents, current setup, and recorded recipes.Likely ownership
pkgs/code-tui/pkgs/omp-configured/default.nixpkgs/omp-configured/README.mdpkgs/cli-kit/only where an existing generic responsive/navigation primitive is genuinely reusable