You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ Mobile remote control for **desktop coding agents** (Claude Code, Codex, Gemini
16
16
-**Spawned children need `error`*and*`spawn` listeners** — an unresolvable command emits `error` async, and unhandled it kills the daemon and every other session.
17
17
-**The useful half of an agent failure is JSON-RPC `data.details`** (sometimes double-encoded), and it arrives twice: as message text, then a rejection. `humanError()` (`errors.ts`) normalises at the one point all transports share. A clean exit is not an error — closing a session always fires `kind: "exit"`.
18
18
-**`resolveWorkspace()` (`workspace.ts`) is the only cwd default** (explicit → `PEW2_WORKSPACE` → daemon cwd → home). Under launchd cwd is `/` and agents treat cwd as project root — GG Coder died on `mkdir '/.gg'`. Session start *and* the capability probe go through it; a third spawn path reintroduces the bug.
19
+
-**A client's `cwd` is honoured only via `knownProject()`, and that check has to outlive the process** — the app re-sends its chosen project on every reconnect and every new conversation, for days. Browsed paths lived in memory alone, so a daemon restart made a genuine pick unknown, and both readers failed *silently*: `workspace.status` answered with the agent's previous project (the composer named a repo the user never picked) and `session.start` then refused the same path. Acceptance is written to `known-projects.json`, and the check reads the probe cache when no probe has landed yet — the app asks in the same breath as the probe it triggers, so recognition must never be a race against a spawn. `session.resume` still falls back rather than refusing (it arrives before the probe), but it may not *guess a project*: it takes the cwd the agent recorded for that conversation, because dropping to the provider's last workspace reopened a chat about one repo with the agent rooted in another.
19
20
-**Two prefs files, deliberately.**`config-prefs.json` (one file for all providers — read-modify-write it) seeds the *next new* session; `session-prefs.json` is replayed on `session/load`, because ACP resumes a transcript but hands back the agent's *default* selectors. Never apply the provider pref to a resume — that rewrites a desk-started conversation to match the phone's last pick.
20
21
-**Session ids die with the daemon; the app's list does not.**`needsResume()` (`agentHistory.ts`) is the single rule for opening a conversation, and an undefined `activeSessions` (older daemon) means *assume live*. Without it a restarted daemon answers `Unknown session '<id>'`.
21
22
-**Projects fold from the *uncapped* session list**, before `SESSION_HISTORY_LIMIT` (`projects.ts`) — the capped list is a recent-work window, so grouping it hides every repo not touched this week. Message counts hydrate per project on demand, never at probe time.
0 commit comments