Skip to content

Add native chat workflows, workspace tools, and execution hosts - #237

Open
nicosuave wants to merge 78 commits into
mainfrom
native-conversation-workspaces
Open

nicosuave wants to merge 78 commits into
mainfrom
native-conversation-workspaces

Conversation

@nicosuave

@nicosuave nicosuave commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Adds native conversation creation and continuation, durable queue and steering controls, structured questions and editable plans, child history, captured annotations and dictation recovery, provider configuration, and chat organization. Exact history search, raw transcript evidence, captured attachment bytes, and uncertain-send recovery remain intact. Sidebar snooze is excluded.

Selecting transcript text offers Add to chat for the exact highlighted text. The viewport quote controls are removed, the prompt outline rail is kept and loads incrementally, attachment failures retain their actual reason, and the filter toolbar button follows sidebar visibility.

Integrates typed MCP forms and interactive MCP apps, provider MCP/plugin administration, shortcut and appearance settings, PR review context, recoverable workspace snapshots, files, Git, terminals, and browser tools. Each session's workspace pane opens to a tool grid and retains the tools opened for that session. Browser recording produces bounded local MP4 files. Separately authenticated execution hosts provide remote files/diff/PTY panels, SSH onboarding, explicit same-chat handoff, fresh-chat and event-triggered schedules, a durable run inbox, and responsive web/mobile controls.

The optional runtime is pinned to a full revision with compiled provenance checks; Developer ID runtime builds also require that revision to be on the runtime repository's main branch. Its changes are in https://github.com/sidequery/mono/pull/509. Public releases must declare their runtime mode and are always history-only. Sending from Home opens the new chat immediately while its workspace and session start. The implementation mapping and capability boundaries are in docs/chat-implementation.md; user documentation is in apps/macos/CONVERSATIONS.md and docs/execution-host.md.

@nicosuave nicosuave changed the title Add native conversations, project workspaces, and browser Add native conversations, workspaces, browser, and terminals Oct 5, 2026
@nicosuave nicosuave changed the title Add native conversations, workspaces, browser, and terminals Add native chat workflows, workspace tools, and execution hosts Oct 5, 2026
- Find: re-searching keeps the selected hit and reveal generation; only a
  newly selected hit advances it. Live revisions rematch only changed records
  and skip searching while Find is closed, and closed Find no longer reaches
  the transcript, so streaming keeps the incremental path and open popovers.
- Outline rail: derive prompts from the live snapshot tail and from loaded
  history windows; scan unread pages only when the rail is used, skipping
  loaded pages, and cancel on selection change.
- Prompt recall: drop window-wide Cmd-Up/Down menu shortcuts; a key monitor
  recalls only in the composer with the caret at the draft edge.
- Shortcuts: reserve Ctrl-Cmd-F, Opt-Cmd-H/M/W and Cmd-E; drop only invalid
  saved bindings at launch; toolbar tooltip follows the configured binding.
- History-only builds: Cmd-N reopens Memex, and new-conversation, project,
  execution host, branch/fork/rewind and parent-draft actions plus browser
  control are hidden. The continuation notice shows only when actionable.
- Transcript: collapse pathologically long chat messages behind Show all;
  revealing a captured passage keeps composer focus, closes disclosures it
  opened elsewhere, and clears only its own error.
- Apply the text-size preference to the composer, tool prose and sidebar
  titles; name the owning provider in the open-elsewhere notice; split the
  reader's history status from the toolbar's history sheets.
TerminalNotices.txt named only Ghostty, libghostty-spm and DisplayLink. The
libghostty.a in the pinned GhosttyKit XCFramework (Ghostty 0538f753) also
contains FreeType 2.13.2, libpng 1.6.43, zlib 1.3.1, Oniguruma 6.9.9,
simdutf 5.2.8, Highway 1.2.0, Wuffs, stb_image, z2d, libxev, libvaxis,
uucode, zig-objc, Zig's standard library and compiler-rt, GNU gettext 0.24
libintl, and embedded JetBrains Mono and Symbols Nerd Font data. Identified
from the archive's object members, symbols, and strings, cross-checked with
Ghostty's pkg manifests at that commit.

License texts come from each project's repository at the pinned version
(MPL 2.0 from z2d's COPYING, LGPL 2.1 from gnu.org). FreeType carries its FTL
credit line. Dual-licensed components state the license Memex uses. The
libintl entry gives the source location and relinking basis LGPL requires.
…Kit list

The shipped SwiftUI sidebar regained what the old conversation list offered:
search-result excerpts via ConversationExcerpt, automatic paging when the end
of the list appears, per-project counts from the project catalog, and the
"Run memex index" empty-state hint. Rows are sorted and partitioned once per
render. NativeConversationList was no longer mounted, so it and its
table-only tests are removed; still-valid behavior moved to sidebar tests.
Typing is written after a short delay while every other change and flush()
remain immediate and durable. Saves merge only this process's sessions under
a drafts.lock flock, attachment bytes of 1 KiB or more live once in
Attachments/<sha256> and are verified on load, and an empty draft with only a
queue hold is no longer stored. Version 1 files migrate on first launch.
Speech authorization and recognition handlers are formed in nonisolated
static factories and hop to the main actor for state, so Swift 6 cannot
infer main-actor isolation for callbacks Speech runs on its own queues.
A new recording replaces the previous one, an inserted transcript drops its
recording, and older orphans are removed at launch.
- Probe native ownership asynchronously off the main actor with an lsof
  timeout and cancellation; probes never overlap, stale results are ignored,
  and viewer polling backs off and pauses while connected or inactive.
- Hold the queue only when an interruption leaves queued work, and release
  the hold once the queue empties.
- Demote a prompt awaiting confirmation to uncertain on disconnect or
  reconnect so it can be restored, and treat Stop during the pre-dispatch
  save as a cancellation that returns the prompt unsent.
- Release side-chat transfer reservations after definite pre-provider
  failures, add Mark transfer inspected for unconfirmed outcomes, and prune
  completed records once the source queue drops the entry.
- Clear unread marks off the main actor without creating metadata for
  browsed conversations, and inject saved entries only where the user
  organized them, never into search results.
- Explain a restart that cannot send and guard the settings timeout by
  connection generation.
…ed remote in draft PRs

User commit and push now run pre-commit, commit-msg and pre-push hooks (Git LFS
uploads) with a PATH that includes Homebrew prefixes; internal Git commands keep
hooks disabled. Command failures report the tail of stderr, setup output keeps
stderr, and draft PRs use upstream/origin as base and the branch's push remote
as head.
Capture reuses blobs for paths whose lstat identity is unchanged since the
previous capture, skips untracked nested repositories with a recorded note, and
keeps the 100 most recent checkpoints per chat, deleting older refs. Restore
streams blobs to staged files with size-scaled timeouts before replacing any
path and names the recovery checkpoint on failure. Branch and checkpoint diffs
use the bounded reader, and nested repositories cannot be staged.
…data

Screenshots fail after five seconds without resuming twice. Terminal scrollback
moves to dev.memex.app/TerminalHistory, migrates the old folder, and is deleted
when its worktree is removed or no longer exists.
… requests

memex-control accepts --conversation or MEMEX_CONTROL_CONVERSATION. A scoped
server rejects conversation, queue, browser and schedule operations aimed at
other chats (its own fork/delegate children excepted) plus create, import,
handoff and schedule.event. The control gateway accepts up to 32 MiB only for
conversation.handoff.install and abort, matching the host socket.
- Send the SSH execution token only after libproc proves Memex's ssh child owns
  the 127.0.0.1 listener; randomize new tunnel ports and disable SSH sharing.
- Serve desktop.sock only to the process holding this root's control.sock.
- Reads take no flock; writes wait at most one second. PTY input is written off
  the host lock with a bounded buffer, and exited terminals are reaped.
- Receipts keep a request digest and bounded result; receipts, finished runs and
  dispatched queue entries are pruned; schedule.runs is bounded with limit/since;
  the notification observer forgets runs outside the host's window.
- A failing queue entry, schedule or run no longer stops the tick; invalid
  managed manifests are listed as invalid instead of breaking workspace.list.
- Missed fixed-time runs appear in the run inbox as skipped.
- Handoff packages are measured before fencing; install/abort get a 32 MiB
  socket limit; hosts pin peer signing keys and refuse self-sourced tombstones.
- Managed checkout verification is cached briefly to shorten lock holds.
Home sends now navigate to a pending chat that shows the prompt and the
workspace/provider start phase instead of a spinner on Home. Failures stay on
that page with the retained draft. Also map hosted settings rejections to
settings errors and drop an unused store helper.
Encrypted or signature-only reasoning parts rendered as empty Reasoning
disclosures. They now stay in the raw transcript only.
- Group headers summarize operations as a sentence ("Ran 2 commands and
  made an edit") instead of "N activities · ..." counts, and reasoning or
  commentary no longer counts as an activity.
- Completed turns fold into "Worked · ..." rather than "Completed work".
- Reasoning rows are titled "Thought", plus the summary heading when one exists.
- The live working indicator names the pending call ("Running swift test")
  or the latest reasoning heading of the current turn instead of a fixed
  "Thinking...".
- Tool results with no output say "No output" instead of a bare heading, and
  calls without arguments get no empty "Input" heading.
- Status lines and calls with nothing to reveal show no disclosure chevron.
Polling isRunning and then waitUntilExit added about 100ms to every git and
CLI command, which slowed checkpoints and pushed the macOS test job past its
time limit.
Point runtime-source.json at mono e610a6f58, the merge of sidequery/mono#509 on main. Against the previous pin it adds only three SQACPHost fixes: live Codex user items no longer duplicate chat prompts, a rejected native cancel fails instead of blocking later commands, and the legacy question fallback restores multi-select guidance. The previous pin stays reachable from mono main.
Send path: show the prompt and the working state before the ownership
probe, keep a new-turn prompt as a transcript row until its native echo
arrives, and allow queueing a follow-up while an earlier prompt is still
dispatching or awaiting confirmation. Delivery safety is unchanged: no
automatic resend, and uncertain prompts still need review.

Streaming: publish on the leading edge at an adaptive 50-250 ms interval,
render from the subscription payload, read control-plane state only at
command and turn boundaries, and space mid-turn source refreshes to 5 s.
The transcript re-renders only the unsettled markdown tail, heals
unterminated markdown, paces text reveal, and follows the end based on
the reader's own scrolling, with a Jump to latest control.

Views: history and live share one NativeTranscript, the new-chat pending
page renders its prompt through it, and in-progress states use a Core
Animation ShimmerText or a DelayedProgress that waits 200 ms. Sidebar
working rows pulse.

Web execution surface: optimistic send reconciled by command ID,
per-action busy state, host-side queue while a turn runs, memoized rows,
stick-to-bottom, no blanking on conversation switch, and state-aware
polling. web/dist is rebuilt.

Adds signposts for send steps and publish cost, and the research behind
these changes under docs/research/agent-chat-feel.

Not exercised against a live provider; verified by build and unit tests
in the runtime-enabled and history-only configurations.
Conflicts:
- Cargo.toml: main's version 0.33.1 with this branch's default-run.
- src/lib.rs: keep both embed_cpu and execution_host.
- ConversationFilters.swift: main's provider list, which adds Kimi and goose.
- .github/workflows/ci.yml: main's mbx commands and Homebrew job, without
  the per-step timeouts this branch removed.
- web/dist/assets/app.js: rebuilt from the merged sources.

Store.swift merged without a textual conflict but no longer compiled:
main's loadRecords stopped keeping the reader generation and request ID
that the created-conversation path checks. loadRecords captures them again.
* Test the code card's copy action without the system clipboard

shortCodeCardHasTightGeometryAndCopiesExactOriginal wrote to
NSPasteboard.general and read it back. On the sidequery/mono runners the
read has returned nil since 2026-10-26, on every runner and with the same
pinned code that passed there the day before, so the Memex runtime
integration job has been red since then. The test also overwrote and then
restored whatever the developer had last copied.

CodeContentView now sends the copied code through a replaceable
copyToClipboard closure that defaults to the general pasteboard, and the
test substitutes it.

* Return the object check directly in the Cursor subagent detector

Clippy in Rust 1.100 extends needless_bool to an `if` that returns true
followed by a trailing false, so CI's `cargo clippy -- -D warnings` fails on
this closure. Behaviour is unchanged.
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