Skip to content

Commit 05ed20b

Browse files
authored
Watch a connector in a terminal, and talk to its orchestrator (#1039)
* Watch a connector in a terminal, and talk to its orchestrator `basecamp connect console -P <profile>` is a full-screen view of a profile's connector: what it is working on and what it did, whether it is well, and how it is set up, with a line that takes what the person types to the orchestrator. It is a process of its own that reads what `basecamp connect status` reads, so it runs beside a connector, before one starts and after one stops, and closing it leaves the connector as it was. It listens on nothing. Everything it draws that someone else wrote, a recording's title or a worker's report, is stripped of terminal control sequences first. - Activity: the workers running, waiting and done, the requests held for a person, and the latest requests heard. A row opens in full, and in the browser at its Basecamp address. - Health: the connector's process, doctor's checks, and each coding agent's CLI with the version it answers. - Settings: who does the work, the rules, Pings, who may give the agent work and the projects served, as they are on disk. Read-only for now. A connector started without an orchestrator says so, with the command that starts one that does the work. doctor's checks move into a function the console shares, and the runner gains read-only helpers for its state file and the installed CLIs. `connect` stays hidden, so the console is hidden with it. * Show the orchestrator's turn as work in the console A request goes to the orchestrator before any worker starts, and for that stretch the Activity screen said nothing was being worked on. It now has a line for the orchestrator while its turn is in flight or messages wait for its next one. * Address review of the console - The whole conversation with the orchestrator has a screen of its own, Talk: under the other screens only its end fits, and a long answer could not be read. - The state directory and connect.json are looked up again for each snapshot, message and health check. A connector's first start under a profile moves the directory an older CLI left, and health was checked against the file as it was when the console opened. - The finished workers listed are the latest to finish, sorted before the list is cut: a worker kept for its thread could finish last and not be listed. - A rule's worker is laid over the default in force, the running connector's, not the file's. - A worker's report is shown whole in its details, not cut to the length the worker list uses. - An activity screen with no rows scrolls, the first row shows under a long explanation, and health is readable in the narrowest window. - A request a person closed without running is listed as heard. - Only the start of a CLI's answer to --version is kept. - The skill says health is as of the console opening or the last r. * Address further review of the console - The orchestrator's line says it is at work, not that it is in a turn: the process its session names may be one a turn that ended left. - What the person tells the orchestrator does not wait behind a snapshot: the lock is held only to copy what it guards. - The empty Talk screen does not say to press / when no orchestrator is running to talk to. * Show the cap on workers as it now is There is no cap unless a start sets one, so Settings says "no limit" or "at most N workers". A running connector's cap is the one it started with: when runner.json has been edited since, the console says the new one applies at the next start. * Address a third round of review of the console - The snapshot reads the ledger's hold, connection and held records alone (Ledger.Glance). Status's counts read the whole of a history that only grows, and the console asked for them every second. - A finished worker that still names a process is listed however old it is: that process is what Health warns of. - The helper that opens a browser is waited for, so it is not left a zombie for as long as the console stays open. - A completed request is "Finished", not a green "Done": how it ended is not carried, and it may have failed. - A message whose answer was lost is "No reply", not "Not sent": it may have reached the orchestrator. - Assignments are said to come from the people named, not from "the people above", which under project trust is everyone on a project. - Settings does not say what a runner.json that cannot be read holds. * Name the lost-answer test for what it now checks * Keep the console cheap to refresh, and readable when small - The latest requests are read off each state's index, newest first, and the search among discarded records stops ten thousand back. On a month-old ledger of a busy account the read went from 72 ms to 12 ms a second, and no longer grows with the ledger's history. - A row keeps its name in a narrow window and gives up what is at its right edge: the coding agent first, then how long. - Up from the first row scrolls to what the screen says over its rows, which a small window could not show beside them. - The start command suggested is one that works: --run only for a profile whose earlier start kept an orchestrator. * Reset the scroll above the first row around its details, and test the reach - Opening a row's details, or closing them, is no longer left scrolled above the first row, which could hide the row selected. - A jump down from above the first row goes where it would have from the row; one step down is back to the row. - The reach of the search among discarded records is tested. * Correct the range a test's comment names
1 parent c1675a0 commit 05ed20b

20 files changed

Lines changed: 3669 additions & 26 deletions

‎.surface-skill-drift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ CMD basecamp connect status
3636
# The connector doing the work itself (--orchestrator): hidden with the rest.
3737
FLAG basecamp --orchestrator
3838
FLAG basecamp --run
39+
CMD basecamp connect console
3940
CMD basecamp connect restart
4041
CMD basecamp connect say
4142
CMD basecamp connect stop

‎AGENTS.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ all of it:
9696
turn's process is recorded before its agent is told anything, and a session is not given
9797
another turn while what its last one started cannot be confirmed ended.
9898

99+
**The console** (`basecamp connect console`, `internal/connector/console`) is the person's
100+
view of all this in a terminal: what is worked on, what was done, doctor's checks, the
101+
coding agents installed, the settings, and a line to the orchestrator. It is a process of
102+
its own that reads what `status` reads (`connectConsole.snapshot`) and writes nothing, so
103+
it runs beside a connector, before one starts and after one stops; what the person types
104+
goes over the runner's socket, as `say` does. Everything it draws that someone else wrote
105+
(a recording's title, a worker's report) goes through `plain` or `text` first: keep it so.
106+
`console.Run` is the one place it starts a bubbletea program, listed in
107+
`internal/tui/launchers_test.go`.
108+
99109
**What agents may do** is one switch, `--permissions`, kept in `runner.json` and read for
100110
every turn. `full`, the default, starts each CLI with its permission prompts off: a headless
101111
turn has nobody to answer one. `guarded` starts each under its own unattended guardrails

‎internal/commands/connect.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ the connector was started with.
118118
basecamp connect say "<message>" talk to the orchestrator
119119
basecamp connect workers list the workers and what each runs on
120120
basecamp connect stop stop it; restart starts it again
121+
basecamp connect console watch it, and talk to it, in a terminal
121122
122123
One connector runs per profile in this state directory. An agent can run
123124
several connections where Basecamp enables adding them for its kind; otherwise
@@ -167,7 +168,8 @@ status and doctor say which this profile's does.
167168
addConnectRunFlags(cmd, &run)
168169
cmd.AddCommand(newConnectSetupCmd(), newConnectShowCmd(), newConnectStatusCmd(), newConnectDoctorCmd(),
169170
newConnectDiscardCmd(), newConnectAskCmd(), newConnectReleaseCmd(), newConnectShadowCmd(), newConnectImportCmd(),
170-
newConnectDispatchCmd(), newConnectWorkersCmd(), newConnectSayCmd(), newConnectStopCmd(), newConnectRestartCmd())
171+
newConnectDispatchCmd(), newConnectWorkersCmd(), newConnectSayCmd(), newConnectStopCmd(), newConnectRestartCmd(),
172+
newConnectConsoleCmd())
171173
return cmd
172174
}
173175

0 commit comments

Comments
 (0)