Skip to content

Improve session navigation, model discovery, and background commands - #2068

Merged
sethkarten merged 17 commits into
mainfrom
feat/agents-view-model-everywhere
Sep 7, 2026
Merged

Improve session navigation, model discovery, and background commands#2068
sethkarten merged 17 commits into
mainfrom
feat/agents-view-model-everywhere

Conversation

@snimu

@snimu snimu commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Simplify the agents view with compact model IDs, total costs, expandable child sessions, and immediate session opening.
  • Open local file links and highlight file references and command options.
  • Refresh Prime Inference models from the live catalog, with offline fallback and team-scoped private models.
  • Let root agents create independent sibling sessions with provider-scoped credentials.
  • Send Shell message received notices through steering at the next safe boundary, without interrupting running tools.
  • Stop owned recovery launches when another authenticated supervisor wins.

Validation

  • Focused Node22 shell steering, supervisor ownership, and runtime/UI tests passed.
  • Python 3.13: 57 shell tests and 104 REPL tests passed.
  • npm run check passed.

Limitations

  • A supervisor recovery launch with no confirmed authenticated winner is left untouched to avoid stopping an active supervisor.
  • Native Windows execution remains unverified locally.
  • A timed-out sibling-session create may leave an idle, unprompted session. It may remain if idle eviction is disabled.
  • Reading an already-completed asyncio wrapper’s cached result may still trigger a completion notice. Awaiting the original handle in its creating cell suppresses it.

Supersedes #2079, #2073, #1145, #1928, #1996, #2053, and #2087.

RES-1308, RES-1314, RES-1275, ENG-5282, RES-1239, RES-1256


Note

Medium Risk
Touches model catalog merging, auth cache migration, daemon session creation, and injected steering messages—important runtime paths with fallbacks, but broad surface area and behavior changes for operators.

Overview
This PR extends Prime Inference model discovery end-to-end: a shared catalog parser in pi-ai reads live /models pricing and specs (with validation and safe code generation via render-models.ts), while the agent merges bundled models with a disk cache and background refresh (PI_OFFLINE=1 skips network). Authorized private routes now return full model metadata, not just ID sets, and the private-auth cache format stores catalog entries accordingly.

The agents view is redesigned around a compact table (session, model on every row, activity, cost/age), inactive sessions collapse by default (alt+i), subagents expand from agent rows (alt+right), and Enter no longer blocks on a loading anchor—opening the selected row always works.

RLM/runtime: depth-0 daemon sessions gain rlm.create_session for sibling top-level sessions with inherited provider credentials; detached bash() process groups emit steering “Shell message received” notices at the next safe boundary while keeping the kernel/session resident until completion. Editor and message UI highlight @path references and --flags (including queued previews).

Daemon: supervisor replacement launches verify authenticated ownership before treating a child as the winner, and kill losing contenders.

Reviewed by Cursor Bugbot for commit 5eee936. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add background Bash completion tracking, live Prime Inference model refresh, compact agents view, and RLM root session creation

  • Background Bash handles now track their creating REPL cell and send bash.completed notifications only when the handle was not awaited by that cell. Sessions stay resident while background Bash work is active (bash.py, repl.py, agent-session.ts).
  • Prime Inference models now refresh from the public models endpoint with bundled and disk-cache fallbacks. Private authorization caches complete model definitions (names, pricing, limits, modalities) instead of just IDs (prime-inference-model-catalog.ts, model-registry.ts, prime-inference-models.ts).
  • The agents view is reworked into compact sectioned tables with shared Session/Model/Activity/Cost/Age columns, inactive-session collapsing (Alt+I), subagent expansion (Alt+Right), and a keyboard actions panel (agents-view-mode.ts).
  • Daemon-backed RLM root sessions can be created via rlm.create_session, which validates inputs, transfers credentials, creates a resident depth-0 session, and returns a typed RLMCreateSessionHandle (daemon-mode.ts, rlm/init.py).
  • Prompt token highlighting now covers @-references and -- options in editors, queued previews, and sent user messages via grapheme-aware masking (prompt-highlight.ts, user-message.ts).
  • Behavioral Change: isPrivatePrimeInferenceModel now uses shared classification (case-insensitive internal/, dev/, or colon-containing IDs) instead of only the internal/ prefix; replacement supervisor launch validates PID-bound authenticated claims and kills competing replacements.

Macroscope summarized 5eee936.

snimu and others added 11 commits September 5, 2026 20:59
Resident summaries carry model info for all session kinds; only the
renderer restricted the label to subagent rows. Drop the special case so
any row whose summary has a model renders provider/id[:thinkingLevel] in
the suffix region, still suppressed while pending delete/kill.
…tails

Consolidates #2087 at dc67428.
Retains #2068 model visibility and #2079 immediate opening and query ownership.
…ntials

Keep managed shell commands active until completion delivery is accepted.
Forward only effective same-provider transient auth when creating root sessions.
Integration fixes for #2053 and #1996.
Preserve serialized private model authorization and shared atomic cache writes.
Retain compact model IDs, full session details, and immediate opening.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/coding-agent/src/modes/daemon/daemon-mode.ts Outdated
Comment thread packages/coding-agent/src/core/agent-session.ts
Comment thread packages/coding-agent/src/modes/interactive/components/prompt-highlight.ts Outdated
Comment thread packages/coding-agent/src/core/messages.ts
Comment thread packages/coding-agent/src/core/prime-inference-model-catalog.ts
Comment thread prime-agent-runtime/src/rlm/bash.py
Preserve sibling PATH and reject root creation after disposal.
Treat background completions as new runs without duplicate as_completed wakes.
Keep table delimiters visible and sanitize live catalog display metadata.
Scope the stale-auth regression fixture to its cached Prime team.
Comment thread packages/coding-agent/src/core/agent-session.ts
Comment thread packages/coding-agent/src/modes/daemon/daemon-mode.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread prime-agent-runtime/src/rlm/bash.py
Preserve alias priority and runtime credential identity when creating sibling sessions.
Pin that a create timeout never dispatches the task prompt.
Preserve late as_completed consumers without suppressing detached completion notices.
Document the cached-wrapper result limitation.
Comment thread prime-agent-runtime/src/rlm/bash.py
Comment thread prime-agent-runtime/src/rlm/bash.py Outdated
Comment thread prime-agent-runtime/src/rlm/bash.py Outdated
Comment thread prime-agent-runtime/src/rlm/bash.py
Wait for process-group cleanup before releasing residency. Defer paused admission within the original request and report terminal rejection.
Preserve notices after cancelled non-owning waits and clean up interrupted task construction.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 96f3620. Configure here.

Comment thread packages/coding-agent/src/core/agent-session.ts
Keep immediate POSIX cleanup and use the existing Windows job cleanup path without referencing SIGKILL.
…unches

Deliver labeled shell completion messages at the next safe turn boundary.
Stop only an owned replacement child that loses to a current authenticated supervisor.
@sethkarten
sethkarten self-requested a review September 7, 2026 06:15
Comment thread packages/coding-agent/src/core/messages.ts
Comment thread packages/coding-agent/src/modes/daemon/daemon-mode.ts
Comment thread packages/coding-agent/src/core/agent-session.ts
Comment thread prime-agent-runtime/src/rlm/bash.py
Comment thread prime-agent-runtime/src/rlm/bash.py
Comment thread prime-agent-runtime/src/rlm/bash.py
Comment thread prime-agent-runtime/src/rlm/bash.py Outdated
Comment thread prime-agent-runtime/src/rlm/bash.py Outdated
Comment thread packages/coding-agent/src/core/agent-session.ts
@sethkarten
sethkarten merged commit b9cf467 into main Sep 7, 2026
23 checks passed
@sethkarten
sethkarten deleted the feat/agents-view-model-everywhere branch September 7, 2026 06:15
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.

2 participants