Skip to content

In-app session initiation across modalities#180

Merged
arach merged 8 commits into
mainfrom
feat/in-app-session-initiation
Jun 3, 2026
Merged

In-app session initiation across modalities#180
arach merged 8 commits into
mainfrom
feat/in-app-session-initiation

Conversation

@arach
Copy link
Copy Markdown
Owner

@arach arach commented Jun 2, 2026

What

This branch began as in-app session initiation (a single flexible POST /api/sessions) and has grown into a broader Scout + platform update. It now also adds image attachments, an embedded file viewer + composer/UI polish in the macOS app, an ACP stdio session adapter, and a landing page refresh.

Area Summary
Session initiation One endpoint; modality chosen by which fields are set
Image attachments Send images human→agent / agent→agent via ephemeral links
Scout UI Embedded file viewer, image paste + lightbox, composer/scroll polish
ACP Stdio session adapter (#181)
Landing Refreshed landing experience (#182)
Studio Agent inspector card study

In-app session initiation (packages/web, apps/macos)

Every modality is one endpoint driven by which fields are set, not a route per modality:

Modality Request
New conversation in a project target.projectPath + execution.session:"new"
New conversation from a message target.agentId + seed.instructions + seed.fromMessageId
Same agent, fresh session target.agentId + session:"new" (server reuses harness/model/name)
Same agent, full prior context target.agentId + session:"existing" + targetSessionId
  • POST /api/sessions resolves the agent's harness/model/projectRoot/name/harnessSessionId as defaults when target.agentId is set; wraps askScoutQuestion and reuses /api/agent-config/snapshot for options (no new options route).
  • askScoutQuestion threads executionTargetSessionId into the broker execution block so session:"existing" resumes a real harness session with full context.
  • seed.branchFrom is accepted and echoed but inert — a forward-compatible hook for separate context-forking work.
  • Scout app: new ScoutSessionService + ScoutSessionComposer modal, with three entry points in ScoutRootView — the conversation-list "+", message right-click → "New conversation from this message…" (prefilled, editable), and the agent inspector's New session / Continue.

Image attachments (packages/web, apps/desktop, apps/macos)

  • Ephemeral blob routePOST /api/blobs stores a base64 image in a TTL'd tmp cache (6h, lazy sweep, never the DB) and returns a fetchable absolute URL; GET /api/blobs/:id serves the bytes. Tuned for first-fetch delivery, not durability — these are session caches.
  • Send threadingattachments flows through /api/send into the broker conversation/broadcast send paths. Persistence + web rendering already supported MessageAttachment, so this fills in the send half.
  • MCP messages_reply — accepts link-backed image attachments, so agents attach URLs they already have (no upload).
  • macOS composer — stage images via ⌘V paste (screenshots, caught at the AppKit level so the field editor doesn't swallow it), drag-drop, or a file picker; thumbnail strip with remove; click a thumbnail for a centered lightbox; image-only sends allowed. Each image uploads to the blob route before the message posts, so the blob is present on the agent's first fetch.
  • Deferred follow-ups: the broker deliver path (direct-to-agent attachment delivery) and MCP messages_send.

Scout file viewer + UI polish (apps/macos)

  • Embedded, resizable file-viewer panel (ScoutFileViewerPanel) opened from file links in messages.
  • Composer, scroll-sentinel/auto-scroll, markdown table, send/mic button, and scroll-styling refinements.

ACP stdio session adapter (packages/agent-sessions) — #181

  • Adds an ACP stdio session adapter (merged from codex/acp-stdio-adapter).

Landing refresh (landing/) — #182

  • Refreshes the landing page experience (merged from codex/landing-improvements).

Studio (design/studio)

  • Agent inspector card study.

Verification

  • Session initiation: /api/sessions exercised — missing target → 400, unknown agent → 404, session:"existing" without a resolvable session → 400; a real M1 start → 200 with conversationId/messageId/flightId and the broker spawning the agent.
  • Image attachments: web server bundles clean; apps/desktop typechecks clean; the macOS Scout target builds clean.

Notes

  • A small focus-ring fix for the selected nav rail item lives in the hudson component library (a separate repo) and is not in this PR.
  • Follow-up (not in scope): re-point OpenScoutMenu's HudRunnerService from the removed /api/runner/* routes to /api/sessions to unify the HUD path.

Add a single flexible POST /api/sessions endpoint plus Scout app
affordances to start new conversations from inside the app, instead of
relying on the orphaned HUD runner (which targeted the removed
/api/runner/* routes).

Backend (packages/web):
- POST /api/sessions: one payload expresses every modality by which
  fields are set — new conversation in a project, "same agent" fresh,
  continue an agent's session with full context, or seed-from-message.
  When target.agentId is set it resolves the agent's harness/model/
  projectRoot/name/harnessSessionId as defaults. Wraps askScoutQuestion;
  options reuse the existing /api/agent-config/snapshot.
- askScoutQuestion: thread executionTargetSessionId into the broker
  execution block so session:"existing" can resume a real harness
  session with full context (verified the /deliver path honors it).
- seed.branchFrom is accepted and echoed but inert — a forward-compatible
  hook for upcoming context-forking work.

Scout app (apps/macos):
- New ScoutSessionService.swift: SessionInitiationSpec/Result service
  (via ScoutWeb.baseURL) + ScoutSessionDraft + ScoutSessionComposer modal.
- Three entry points in ScoutRootView: "+" in the conversation-list
  header (new in project), a message context menu ("New conversation
  from this message…", prefilled + editable, plus copy actions), and
  ScoutAgentInspector "New session" / "Continue" buttons (fresh vs.
  full-context resume; Continue shown only when a session is resolvable).

Also carries in-progress UI refinements (message-list scroll sentinel /
auto-scroll, markdown table, send/mic buttons, scroll styling, composer
padding) that were already in the working tree.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openscout Ready Ready Preview, Comment Jun 3, 2026 3:09am

Settled direction for the Scout sidebar per-agent card:
- no AVAILABLE tag — presence rides the avatar dot
- identity header is clickable to the agent profile
- one cohesive card with Runtime / Workspace / Session / Skills sections
- Observe lives inside the Session block (you observe a session) and only
  appears when there's a live session; reads as a button at rest
- New session is a quiet inline link
- session id rendered as the real opaque id (prefix + suffix), not a relay label
Image attachments (human→agent context, agent→agent links):
- Ephemeral blob route (POST/GET /api/blobs): base64 image → TTL'd tmp
  cache, returns a fetchable absolute URL; optimized for first-fetch
  delivery, never touches the DB
- Thread attachments through /api/send into the broker conversation and
  broadcast send helpers (persistence/rendering already supported them)
- MCP messages_reply accepts link-backed image attachments
- macOS composer: ⌘V paste (screenshots), drag-drop, and a paperclip
  picker → upload → send, with a thumbnail strip and image-only sends

Conversation/channel display:
- DM peer labels and channel-name helpers on ScoutChannel
- Conversation list/row and agent/channel inspector refinements
- Session service updates
arach added 2 commits June 2, 2026 22:12
Add a first-class ACP client adapter for subprocess-backed JSON-RPC stdio agents, including prompt/session handling, permission request mapping, guarded file access, adapter spec coverage, and pairing runtime registration.
arach added 2 commits June 2, 2026 22:19
Update the landing page layout, styling, and Scout console treatment with the new mac roster asset.
💄 Refresh landing page experience
Inspector / chrome:
- agent card: Session block hosts Observe (only with a live session), real
  opaque session id (head+tail), brighter rest-state on Observe
- sidebar resize floor lowered to hug the labels; tighter default
- one-line chat header (cId/members were redundant with the card)
- compact icon scope filter tucked onto the search row
- model 'Default' note moved from a two-line sentence to a tooltip
- pointing-hand cursor on clickable (.plain) controls

Design experiments (toggleable via a dev panel, off by default):
- Depth (top-light + soft shadow), Accents (eyebrow ticks + selection
  bloom), Glow (ambient backlight on the conversation list)

Embedded file viewer:
- click a message file-link to preview in-app (trailing slot), ⌘-click
  pops out to the editor; resizable + persisted width
- syntax highlighting (in-house tokenizer), line numbers, target-line jump
- agent-aware path resolution (relative paths resolve to the sender's
  workspace), folder paths reveal in Finder
- read + highlight off the main thread; long-line + size guards
@arach arach merged commit f453ae4 into main Jun 3, 2026
3 checks passed
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