Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .memory/coding-follow-through.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Coding follow-through — 2026-10-26

Background jobs, following a pull request until it merges, and `/until <check>`. Plan: docs/plans/coding-follow-through-plan.md; guide: docs/coding-follow-through.md. Code lives in `main/services/follow-through/` with shared contracts in `renderer/shared/{agent-notices,background-jobs,follow-through}.ts`.

Owner rules (2026-10-26): job ends are reported to the chat; macOS and Linux; following builds on `main/services/github/`; only owner/write-access comments reach the agent; logs are data; the check loop stops after 5 tries. Do not name the research source in PRs, commits, code or docs.

Design decisions worth keeping:

- A notice is a user-role message with a `notice` field (`AgentNoticeV1`); the content is model-facing and fences untrusted text with `fenceAsData`. Clients without a card show `agentNoticeDisplayText` (the Remote projection does this, so phones need no change and there is no protocol revision).
- Delivery order: queue into a running turn (`llmClient.admitAgentNotice`), else start an unattended turn (headless owner, approvals and questions detached, no subagents/Computer Use/MCP) when `wake` is true and the chat has wake budget left (6/hour), else append only. Never wake for passes, merges or closes, or the loop never settles.
- The agent's own GitHub comments come back as `byViewer` comments; they are dropped only when made during that chat's run windows (from `hostRunRegistry`), so the person writing on GitHub with the same account still counts.
- `BackgroundJobs.settle` marks a job watched so a job that ends during the tool's start wait is reported once (in the tool result), not twice.
- Crash reaping matches pid and `ps -o lstart=` start time before signalling a leftover process group. If the shell had already exited, it signals only group members whose environment has `AIDEN_BACKGROUND_JOB=<job id>` (`/proc/<pid>/environ` on Linux, `ps -E` on macOS), re-listed before each of up to 3 SIGKILL rounds (a TERM handler can spawn a child); marked survivors stay in `running.json` via `carriedOver`, which every record write includes. While Aiden runs, a shell's `exit` ends the rest of its group, because `close` waits for every holder of the output pipes.
- Seen comment ids always keep every id the latest read returned (up to 660 per read) plus 300 older ones.
- `/until` replacing a running check with runNow waits for the old run to stop (`runWhenFree`), then runs.
- A done-when check interrupted by quit returns to waiting with its count restored; nothing reruns on launch.
- `llm-client.ts` imports follow-through tools dynamically to avoid an import cycle; only `background-job-tool.ts` is imported statically (for the Ask-mode approval check).

Tests: `npm run test:follow-through` (registered in `test:serial` and the core-git/renderer-other lanes). coding-tools.test.ts needs `npm run build:worktree-file-io`, `node scripts/build-worktree-file-io.mjs --test` and `npm run build:subagent-file-mutator` first in a fresh container, or 9 pinned-write tests fail.

Found by driving the real app (2026-10-26), now fixed:

- A notice saved without a turn must also send `chats:follow-through-changed` with `transcript: true`; plain `chats:changed` only refreshes the chat list, so the open chat never showed the card.
- Follow-through slash actions commit with the draft-only guard (like clone/export/worktree); the full guard left `/until npm test` in the composer with a "newer draft" toast.
- The jobs list refreshes its clock when it opens; it used to show the time since the chip first appeared.

Screenshots: a throwaway Playwright spec (never committed) seeds PR notices, captures with `webContents.capturePage()` at 2880x1800 / zoom 2, and switches theme through the command palette (Search settings, then Use dark appearance); setting `nativeTheme.themeSource` alone does not change Aiden's theme.

Open: native phone cards, CLI support, hand check on a real Mac.
1 change: 1 addition & 0 deletions PRODUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The primary application is an Electron desktop app for macOS and Linux. People w
- Treats the desktop host as the authority for workspace files, credentials, agent execution, durable memory, and paired-client operations.
- Requires deliberate user actions for external connections, sensitive permissions, and destructive or durable mutations.
- A Bot can suggest a one-time or recurring routine in its chat. The person accepts the proposal before Aiden schedules future turns in that Bot's durable conversation; execution depends on the desktop scheduler and current Bot access. Each due fire is saved before the schedule advances and reconciled with Pi after a restart; the Bot's Routines page shows pending or overdue work.
- Coding follow-through keeps a workspace chat moving after an answer ends: background jobs report when they end, a followed pull request reports failed checks, conflicts and comments from people with write access until it merges, and `/until` reruns a check after each answer, five checks at most. News arrives as compact notice cards; command output, CI logs and comments are fenced as data, and a chat starts at most six unattended follow-up answers an hour. macOS and Linux desktop; see [docs/coding-follow-through.md](docs/coding-follow-through.md).
- Bots ask you to sign in in their own browser; the model never sees your password.
- Bot computers (Apple silicon): an opt-in macOS VM per Bot, which the Bot sees and uses with its own `computer` tool (screenshots and clicks, each step with a stated intent the rules read) and `computer_shell` tool, on routine runs too. The Bot panel's Computer tab shows it live with the Bot's avatar where it last pointed; the person's first click or key, or Take over, stops the Bot's current action until Give back, and Float over chat keeps the screen in view. Element control (Aiden's pinned cua-driver in the base computer, allowed once for Accessibility and Screen Recording and inherited by every Bot computer made from it) lets the Bot read an app's buttons and fields and click them by number, and the rules then also read the element acted on; skipping it keeps screen-only Bots. A Bot can ask the person to sign in on its own computer: Open hands the person the computer with Safari at the site, the Bot's computer tools wait, and the password never reaches the model. The onboarding tour introduces Bot computers only where they exist. See [docs/bot-computers.md](docs/bot-computers.md).

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ I don't come from a coding background. I'd been bouncing between the coding agen
- **Models and the Model Pad** - choose from Pi's native hosted-provider catalog, local Ollama or LM Studio models, and declarative compatible endpoints. Arrange a personal capability-and-pace map, optionally enrich hosted models with explicitly fetched Artificial Analysis scores through a benchmark-only OpenRouter key, and keep benchmark evidence visibly separate from runtime limits and availability.
- **Terminal, Git, and review** - keep a terminal drawer beside the conversation, inspect files and diffs in Environment, edit with dirty-file protection, compare branches, commit or push checked snapshots, and open the workspace in a discovered external editor.
- **Workspace artifacts** - ask Aiden for a page such as the open PRs or a release checklist and it keeps it in an **Artifacts** tab beside the chat, re-reading its data from commands or workspace files under the workspace's access setting, with buttons that ask Aiden, fill the composer, or run approved commands. Desktop only; see [workspace artifacts](docs/workspace-artifacts.md).
- **Coding follow-through** - the agent can leave a dev server or long test run going as a background job and hears when it ends; `/follow` keeps a chat on its pull request until it merges, reporting failed checks with the end of their logs, merge conflicts, and comments from people who can write to the repository; and `/until npm test` keeps the agent fixing until a check passes, five checks at most. macOS and Linux desktop; see [coding follow-through](docs/coding-follow-through.md).
- **Rich responses and local diagnostics** - render sandboxed HTML, chart, math, and raster artifacts with recovery/export controls, and inspect or export bounded local diagnostics without an automatic upload path.
- **Desktop integration and appearance** - native menus, encrypted system credential storage, **Parakeet**, the dictation pill, semantic themes, high contrast, reduced motion, and consistent light/dark rendering. Apple **Foundation Models**, Accessibility auto-paste, and the signed **Rust** Computer Use broker remain macOS-only. On Apple silicon, Parakeet also runs on the GPU through **transcribe.cpp** (Metal) and shows dictated words in the pill and the composer as you speak; Intel Macs, Linux and the CLI keep sherpa-onnx.
- **Shared browser and annotations** - browse beside the chat in Environment, preview workspace HTML/PDF files, use isolated profiles and responsive viewports, and share selected text, elements, drawings, and image crops with Aiden. Aiden's browser tools operate on those same tabs. See [browser behavior and controls](docs/environment-browser.md).
Expand All @@ -71,7 +72,7 @@ The roadmap is maintained in [the plan index](docs/plans/README.md). These bulle

Aiden stores chats, settings, workspace metadata, and downloaded speech models locally. Provider credentials and MCP OAuth sessions use the operating system's encrypted credential storage. Linux refuses to store secrets if only Electron's reversible `basic_text` backend is available. The renderer is sandboxed, has no direct Node.js access, and communicates with Electron through an allowlisted bridge.

Network access happens only when the selected feature needs it: hosted models receive the conversation content sent to them, cloud transcription receives selected audio, Exa receives search queries, remote MCP servers receive tool requests, and model downloads contact their upstream host. A fully local session can use a local model, on-device voice, no remote MCP servers, and web search disabled.
Network access happens only when the selected feature needs it: hosted models receive the conversation content sent to them, cloud transcription receives selected audio, Exa receives search queries, remote MCP servers receive tool requests, and model downloads contact their upstream host, and a pull request that a chat follows is read from GitHub every few minutes until the follow ends. A fully local session can use a local model, on-device voice, no remote MCP servers, and web search disabled.

On macOS, Computer Use is an opt-in beta with a global switch, permission checks, and exact target binding. The model's first Computer Use call in a chat raises one access card (Deny, Allow for this chat, or Always allow); an allowed chat then acts without per-action cards, and Settings can turn off Always allow or reset chat permissions. It is omitted from Linux builds. See the [Computer Use security design](docs/computer-use-integration.md) for the complete boundary.

Expand Down
2 changes: 1 addition & 1 deletion docs/aiden-remote-api-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Since contract revision 28, an assistant message may carry an additive `visuals`

Subagents remain a Mac-local implementation detail of the parent Pi turn unless the authenticated device negotiated `agents:read`. A device without that grant receives only the ordinary parent messages, parent timeline and outcome, and parent stream state—never child/subagent IDs or counts, private histories, lifecycle snapshots, child controls, or child-specific endpoints. A negotiated device receives only the bounded public `ChatAgentRoster` projection described below; it still never receives private run/session/group/generation/child/workspace identifiers, child transcripts, prompts, or tool arguments/results. The only child control is the public-ID stop described under `POST /chats/{chatId}/agents/{agentId}/interrupt`, which is available only when the Mac advertises `chat-agent-interrupt-v1`. A child result may affect the parent's eventual visible reply through the normal parent runtime, but it is never projected as a separately addressable private object.

Within its documented 200,000-Unicode-scalar bound, visible parent `message.text` is opaque transcript data and is preserved exactly. Privacy filtering applies to DTO fields and metadata, not to the appearance of visible text: Unicode, path-like text, URLs, UUIDs, base64- or hexadecimal-looking strings, and credential-shaped text are not rewritten, encoded, or replaced with a redaction marker. This does not authorize separate credential metadata; credentials, authorization headers, provider/MCP secrets, and API-key fields remain forbidden outside the visible transcript.
Within its documented 200,000-Unicode-scalar bound, visible parent `message.text` is opaque transcript data and is preserved exactly. Privacy filtering applies to DTO fields and metadata, not to the appearance of visible text: Unicode, path-like text, URLs, UUIDs, base64- or hexadecimal-looking strings, and credential-shaped text are not rewritten, encoded, or replaced with a redaction marker. This does not authorize separate credential metadata; credentials, authorization headers, provider/MCP secrets, and API-key fields remain forbidden outside the visible transcript. One kind of user-role message is projected differently: a follow-up notice that the host wrote into the chat (a background job ended, a followed pull request had news, or a done-when check ran; see [coding follow-through](coding-follow-through.md)) carries its one-line heading as `text`, for example `A check failed: #42 in acme/app · unit`. Its model-facing text, with fenced command output and CI logs, stays on the desktop. The wire shape and revision are unchanged.

Forbidden: Pi journals, raw diagnostics, raw tool arguments/results not already safe for renderer display, every child/subagent projection described above, hidden/system prompts, credentials or authorization headers outside visible parent message text, provider/MCP headers and API keys, filesystem/skill metadata, owned asset filenames, temporary asset URLs, and filesystem internals.

Expand Down
Loading
Loading