@proagentstore/cli 0.4.43 → 0.4.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -154,10 +154,26 @@ export class HeadlessSession {
|
|
|
154
154
|
get authResolved() {
|
|
155
155
|
return resolveEngineAuth(this.config.clientType, mergeEnv(process.env, this.config.env));
|
|
156
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Did this engine launch with a conversation to continue (#408)?
|
|
159
|
+
*
|
|
160
|
+
* Reported back to the cloud by `/coding/start` so the sentence the agent says to the user is
|
|
161
|
+
* something this side CONFIRMED rather than something the cloud asked for. The distinction is
|
|
162
|
+
* not academic: a runner published before #408 ignores `resumeFrom` entirely and always starts
|
|
163
|
+
* clean, so a cloud that announced "resumed where we left off" on its own intent would be
|
|
164
|
+
* telling most of the fleet's users the opposite of what happened.
|
|
165
|
+
*
|
|
166
|
+
* False for a raw (non-Claude) engine under every circumstance — `--resume` is a Claude Code
|
|
167
|
+
* flag and {@link buildClaudeArgs} is only reached in stream-json mode.
|
|
168
|
+
*/
|
|
169
|
+
get resumedConversation() {
|
|
170
|
+
return this.mode === "stream-json" && this.claudeSessionId !== null;
|
|
171
|
+
}
|
|
157
172
|
constructor(config) {
|
|
158
173
|
this.config = config;
|
|
159
174
|
this.engineLabel = `${config.clientType}:${config.id}`;
|
|
160
|
-
|
|
175
|
+
// Our own key first, the cloud's nominated predecessor second. See `resumeFrom`.
|
|
176
|
+
this.claudeSessionId = readState(config.statePath, config.id) ?? (config.resumeFrom ? readState(config.statePath, config.resumeFrom) : null);
|
|
161
177
|
// Claude is the structured engine; everything else is a raw CLI.
|
|
162
178
|
this.mode = config.clientType === "claude" ? "stream-json" : "raw";
|
|
163
179
|
const { bin, args } = parseCommand(config.command);
|
|
@@ -89,12 +89,17 @@ export class CodingRuntime {
|
|
|
89
89
|
command: input.command,
|
|
90
90
|
env: input.env,
|
|
91
91
|
statePath: defaultStatePath(this.reposBaseDir),
|
|
92
|
+
resumeFrom: input.resumeFrom,
|
|
92
93
|
bin: input.bin,
|
|
93
94
|
});
|
|
94
95
|
this.sessions.set(input.sessionId, session);
|
|
95
96
|
}
|
|
97
|
+
// Read BEFORE `start()`: a bad `--resume` can kill the process on spawn, and the engine
|
|
98
|
+
// clears its own key on that exit. Reporting after would say "started clean" about a launch
|
|
99
|
+
// that did carry a conversation, and the transcript (which shows the crash) would disagree.
|
|
100
|
+
const resumed = session.resumedConversation;
|
|
96
101
|
session.start();
|
|
97
|
-
return this.snapshot(input.sessionId);
|
|
102
|
+
return { ...this.snapshot(input.sessionId), resumed };
|
|
98
103
|
}
|
|
99
104
|
/**
|
|
100
105
|
* The pane the brain reasons over + the inferred run state.
|