Repository navigation
Description
Status after #653 (2026-09-09)
Landed on dev. The wire now carries Hello.Join (attach to the conversation open under this transcript, never start one) and Hello.Watch (a read-only surface that is never given the keyboard), protocol 12 (internal/remote/wire.go); MethodTake still moves the keyboard in one round trip and drafts survive. Plain aforge chat goes through the host by default, and closing a terminal detaches rather than stops (TestDetachingFromAHostLeavesTheConversationRunning, internal/remote/detach_test.go). From the tasks place, a task running in another window opens live and read-only (enter read it as it runs).
Still open. Acceptance items 1 and 2 as written: a locked row on home still opens a staging conversation and offers takeover rather than opening the locked chat in watch mode, and what can be watched is a task's transcript, not the chat itself. Relay deployment remains out of scope.
Product requirement
Multiple aforge instances — local terminals or SSH remotes — connecting to a
workspace with an open chat must be able to open that chat. Every attached
surface is offered the choice to WATCH (live read-only transcript) or TAKE
CONTROL (the keyboard moves in one round trip, drafts preserved). North star,
in the person's words: "It should not be that any chat is unreadable from a
terminal."
Current state (doc vs code)
The remote half is built and already matches the requirement:
internal/remote/driver.go— the keyboard follows the newest window; every
other attached surface becomes a watcher with a live transcript;
MethodTakemoves the keyboard in one round trip; drafts are preserved
across hand-offs.internal/tui3/watching.go— watcher UX: dim "typing from<surface>now"
line;entertakes the keyboard back.internal/enginehost/— persistent per-workspace session host on a unix
socket, attach-or-spawn (flock-guarded), survives disconnects; wired into
aforge engine/--host(cmd/aforge/engine.gotries attach →
host-spawn → pipe-floor).- Relay + pairing:
internal/relay/,internal/pair/,
cmd/aforge/chatv3_at.go(aforge serve,--at otter-lamp-42,
aforge devices). No default relay URL is deployed (deliberate;
AFORGE_RELAYenv) — see open questions.
The gap is local:
openV3Agent(cmd/aforge/chatv3.go~line 955) on
session.ErrSessionLockedsilently starts a NEW conversation
("session open elsewhere — started a new one") instead of attaching.- The home switcher refuses locked rows (
sessionBusyWord= "open in another
window — go there, or start a new conversation here";
internal/tui3/welcome.go:268,internal/tui3/home.go:2702). - enginehost is never wired into plain local
aforge chat— only--host/
aforge engine.
Requirement to build
Route local opens through the session host (or equivalent) so a second local
terminal gets the same watch/take-control surface a remote gets: attach on
lock, never a silent new conversation, never a refusal.
Acceptance
- Two local terminals, same workspace, one live chat: the second opens it as
a watcher with live transcript and the dim "typing from …" line;enter
takes control; the first surface becomes the watcher. - Home switcher: a locked row opens into watch mode (with take-control
available) instead of being refused. - No code path silently starts a new conversation because a session is
locked. - Drafts survive a keyboard hand-off in both directions.
- Remote (
--at) behavior is unchanged and its tests still pass.
Decisions (groomed)
- Local
aforge chatroutes through the session host by default — every
workspace gets a host, one code path, the same story local and remote.
Attach-on-lock-only is rejected: it keeps two code paths alive and the
host's persistence (survive a closed terminal) is a benefit locally too. - Home switcher locked rows open directly into watch mode with
take-control available — the "go there" refusal is removed. - Silently starting a new conversation on lock is dead. The north star
is the person's own sentence: no chat unreadable from a terminal. A new
conversation is started only when the person asks for one. - Relay deployment is out of scope for this release.
AFORGE_RELAYand
aforge serve/--atremain the remote story; a default relay URL is an
infrastructure decision for a later milestone.
Drafted with CodeAF · reviewed and owned by the author
Activity
santoshkumarradha commentedon Aug 31, 2026
Multi-attach: any chat reachable from any terminal — plan for #52
Written 2026-08-31 against
dev@d0ad600b. This is the plan forissue #52, and it changes one of
the issue's groomed decisions, for a reason the grooming did not have in front of it.
What already exists (verified in code)
internal/enginehostMethodTakemoves it in one round trip, a detach hands it to the newest survivor, drafts keptinternal/remote/driver.gotyping from <machine> now · enter takes it back, box hidden not clearedinternal/tui3/watching.goaforge engineattaches to the host, spawns one, or serves on the pipe;--no-host,--stopcmd/aforge/engine.goopenjoins a hello to a session already running under that key — "THE WHOLE PRODUCT IS THIS LINE"internal/enginehost/host.go:277The gap is exactly the issue's: nothing local ever dials the host.
aforge chatopens thesession in-process; a second terminal meets the journal's flock and
openV3Agent(
cmd/aforge/chatv3.go:976) silently starts a new conversation; home's held row isrefused with
open in another window — go there, or start a new conversation here.The fact the grooming did not have: what a connection switches OFF today
Every capability below is on in a local in-process session and off or degraded over
the wire, at the engine (
cmd/aforge/engine.go:355-441) or at the surface(
internal/tui3/host.go:45-110, the honesty table). Decision 1 as written — "localaforge chatroutes through the session host by default" — would turn all of it off forevery local session on the day it lands:
door for; the engine builds with
session.New, so the model does not have the verb.engine (
Config.HarnessStore = nil,HarnessCardsfalse) — same reason, no wire doorfor the standing lanes.
internal/remote's held room deliberately holds four kinds ofquestion and not five.
/connect): the ask card offers only "not now" (the browser ishere, the loopback port is there). Key sign-ins work.
/settings: opens with a warning; the session half reads the other end's profile.allowed, notsaved.--max-hours/--max-costceilings: refused ("cannot travel")./harnessregistry door: absent. The git branch probe: off. Changing a runningtask's model: absent.
tabbetween them, home as aswitcher rather than a swap (
internal/tui3/keeper.go) — over a linkOptions.Openisnil, so home falls back to
Resume, which SWAPS which session the connection holds.(
bootEnginechdirs; "the only chdir in the tree"). Enter on another project's rowover a link opens it in the wrong host's process or not at all — not verified either
way, but the law says it cannot be right.
docs/REMOTE.mdalready names the fix for the biggest of these: "What would light thisup is a wire door for the standing lanes, which is a lane of its own."
Staging — the change to decision 1
Decision 1 is kept as the end state and split into two releases. Flipping the local
default before the wire carries the standing lanes is a regression a person would meet on
the first
/taskthat divides its work, and "one code path" is not worth that. Thein-process door and the host door are both real today; R1 uses the host wherever it is
the only way to reach a chat, and R2 makes it the only door once nothing is lost by it.
R1 — no chat unreadable from a terminal (this wave)
Acceptance 1–5 of #52, without regressing a single-window local session.
aforge chat(andaforge resume) tries the workspace's host first:enginehost.Attach(workspace, spawn "engine --daemon")gives anet.Conn; thesurface is opened by the same
openChatV3Hostroad with a local dialer instead of anssh child (
remote.Roamalready takes anyio.ReadWriteCloser). When to takeit: when a host for this workspace is already up (something is open there), or when
the requested session's journal is locked. Otherwise the in-process door runs as
today — every capability above intact.
--no-hostforces in-process; it existsalready on
aforge engineand gets the same meaning onchat.openV3Agent's lock fallback becomes a refusalthat names the road: the host attach above is tried before the in-process open, so
the only way to reach this branch is a lock held by something that is not a host (a
build older than this one). The sentence says so and points at
aforge engine --stop.homeHeldNowdoes notrefuse: enter opens the row through the link and the host joins it (watcher, or driver
if it is going spare). With no link (a plain in-process window whose row is held by a
host on this machine), enter dials that workspace's host and opens the row there —
the same road as 1, from inside a running surface. The one row that stays refused is a
journal locked by a non-host process, with the sentence from 2.
hosted()isa.host != ""today and gates far-machinebehaviour (home reads the far world, paths carry the machine name, the honesty table
fires). A local host is a link with no machine:
linked()for the keyboard/watcherhalf,
hosted()stays for the far-machine half. Status line: noviasegment; thewatcher line reads
typing from another window now(already the same-machinespelling in
watching.go).home.md§"Why can't I open a session from home" rewritten (it becomesa door),
keeping-an-eye.md/screen.mdfor the watcher line locally, probes:"open the chat that is running in my other terminal", "two terminals same chat",
"take control from the other window", "why did it start a new conversation".
What R1 deliberately leaves: the keeper over a link (home is a swap there, as it is over
--hosttoday), cross-project rows over a link (refused with a sentence naming theother project's own terminal — measured, not guessed), and every OFF row in the table
above for the hosted window only. A person who never opens a second terminal on a chat
never meets any of it.
R2 — one door (next wave, gated on the wire)
through the held room), subharness cards, task model change. This is the lane
REMOTE.mdnames; it is the bulk of R2.frame) so home stays a switcher.
for several workspaces — needs the chdir law rewritten (per-engine cwd), which is a
session-package change.
aforge chatdials the host always;--no-hostremains the escape hatch;the in-process door survives only as the host's own engine boot.
Lanes for R1
Each lane is a worktree off
dev, integrated in the order below; each carries its owntests and manual pages.
openChatV3Local(host attach →remote.Roamover the socket), the when-to-take rule,--no-hostonchat/resume, the lock refusal replacing the silent newcmd/aforge/chatv3.go, newcmd/aforge/chatv3_local.go,internal/enginehost(aDialerfor a live host), tests incmd/aforgeandinternal/enginehostlinked()vshosted(), home's held row through the link and through a fresh local dial, the watcher line's local spelling, the two-window test with a lab hostinternal/tui3/home.go,hostlink.go,host.go,watching.go,welcome.go, testsdocs/that opens two terminals on one chat, checks the watcher line,enterin both directions, drafts kept — the--host localhostrecipe indocs/remote-access-testing.md §3dwith no sshinternal/manual/chat/*.md,internal/manual/chat_test.go,docs/multi-attach-testing.mdL1 and L2 can run in parallel against an agreed seam:
tui3.Options.Linknon-nil withHost == ""means "linked, local". L3 starts when L1 lands (it needs a binary).Open rulings
and accept the OFF table for every local session.
dial a second host and swap the client (a bigger L2).
construction — the host outlives the pipe) — or should a lone window's close retire
its host at once, keeping today's "closing the terminal ends the conversation"?
santoshkumarradha commentedon Aug 31, 2026
Split for R1/R2 (plan above):
Rulings taken for R1: staging accepted; cross-project rows over a link are refused with a sentence; a host's own idle sweep governs persistence (an idle conversation with nobody attached retires as the host already does).
santoshkumarradha commentedon Aug 31, 2026
R1 as split (#63 #64 #65) is closed: the immediate need turned out to be take it over in another terminal, which the hand-off in #71 delivers with no host and nothing switched off. This issue stays open for the simultaneous watch/take-control story; #66 is its remaining work. PR #70's lock refusal and
--no-hostare kept.AbirAbbas commentedon Sep 16, 2026
Closing as not planned. Since #653 the north star here, "no chat unreadable from a terminal", is met a different way than this issue drew it: every conversation goes through the machine's session host by default, any terminal can open it, the keyboard moves to the newest window in one round trip, and the old window detaches to home rather than closing (
internal/tui3/takeover.go, pinned byTestAMovedWindowDetachesRatherThanClosingTheConversation). A task running in another window opens live and read-only.What is left of the original acceptance, opening a held home row in watch mode and watching a chat rather than a task, has had no lane and no design since 2026-09-09. Reopen if watch mode for a live chat is still wanted.