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:
@@ -101,6 +101,14 @@ const resolveCwd = (home: string, cwd?: string) => {
|
||||
return join(home, cwd);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param home an absolute filesystem path — NOT an email.
|
||||
*
|
||||
* It took an email until `95951fb`, resolved its own root, and both parameters are `string`, so the change of
|
||||
* meaning was invisible to the compiler and to every caller outside that diff. Three of them kept passing an
|
||||
* email and silently began building relative paths out of an address. If a fourth caller ever appears, this
|
||||
* line is the warning it gets.
|
||||
*/
|
||||
export const resolveBaseCwd = (home: string, cwd?: string) => resolveCwd(home, cwd);
|
||||
|
||||
// The email chat runs from the selected account's storage dir:
|
||||
|
||||
Reference in New Issue
Block a user