stop building cwds out of an email address
host found a live regression from95951fb, on the owner's own paths. resolveBaseCwd used to take an email and resolve its own root.95951fbmade the first parameter the home itself, and three callers outside that diff kept passing an email: pipeline-executor twice and agent-handoff once. Both parameters are string, so tsgo had nothing to say. Every pipeline step and handoff with a relative cwd, a `~`, or no cwd was building a path out of an address, resolving it against the platform's own working directory — the checkout. Absolute paths kept working, which is what would have made it look intermittent. All three are owner-only, so they now pass getOwnerHomeDir(email) explicitly, the way agent-runner does. The definition of resolveBaseCwd carries the warning: an absolute path, NOT an email, with the reason. Not done: the branded type this argues for. Two strings meaning "identity" and "filesystem path" sat adjacent through a refactor and the compiler could not help, which is a real gap — but it reaches every path function in the server, and doing it at 01:00 on the back of a bug caused by a hasty refactor would be the joke telling itself. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { getUserById, markAgentPanelIntroduced, type AgentPanel } from 'officerd
|
||||
import * as sidecar from '@@/sidecar-registry';
|
||||
import { resolveBaseCwd } from '../chat/websocket';
|
||||
import { logger } from '../chat/logger';
|
||||
import { getOwnerHomeDir } from '@@/data-path';
|
||||
|
||||
/**
|
||||
* Push a turn into an agent panel's session — with or without a browser attached.
|
||||
@@ -33,7 +34,7 @@ export async function deliverToAgentPanel(target: AgentPanel, prompt: string): P
|
||||
username: user.name ?? user.email,
|
||||
prompt,
|
||||
sessionKey: target.sessionKey,
|
||||
cwd: resolveBaseCwd(user.email, target.cwd ?? undefined),
|
||||
cwd: resolveBaseCwd(getOwnerHomeDir(user.email), target.cwd ?? undefined),
|
||||
// Deliberately no `model`: a live session ignores it anyway, and a resumed one keeps whatever the
|
||||
// panel started with. Passing one here would only look like it worked.
|
||||
durable: true,
|
||||
|
||||
Reference in New Issue
Block a user