overlord-cli 4.20.0 → 4.21.0
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.
- package/bin/_cli/launcher.mjs +25 -2
- package/package.json +1 -1
package/bin/_cli/launcher.mjs
CHANGED
|
@@ -173,8 +173,31 @@ async function runAgent(agent, mode = 'run') {
|
|
|
173
173
|
} else {
|
|
174
174
|
execFileSync('opencode', ['--prompt', context], { stdio: 'inherit', env: childEnv });
|
|
175
175
|
}
|
|
176
|
-
} else {
|
|
177
|
-
|
|
176
|
+
} else if (agent === 'gemini') {
|
|
177
|
+
// Write context to a temp file. Passing inline content as a positional arg
|
|
178
|
+
// causes Gemini's @-reference parser to lstat(cwd + content) when it encounters
|
|
179
|
+
// @ symbols in the markdown (e.g. "@@ -10,6 +10,14 @@" in JSON hunk examples),
|
|
180
|
+
// producing an ENAMETOOLONG crash. Using @file keeps the path short.
|
|
181
|
+
const tag = `overlord-${ticketId.slice(-8)}-${Date.now()}`;
|
|
182
|
+
const contextFile = path.join(os.tmpdir(), `${tag}-ctx.md`);
|
|
183
|
+
fs.writeFileSync(contextFile, context, 'utf-8');
|
|
184
|
+
setTimeout(() => { try { fs.unlinkSync(contextFile); } catch { /* already gone */ } }, 30 * 60_000).unref();
|
|
185
|
+
|
|
186
|
+
if (mode === 'resume') {
|
|
187
|
+
const geminiSessionId = process.env.GEMINI_SESSION_ID?.trim();
|
|
188
|
+
const resumeTarget = geminiSessionId ?? 'latest';
|
|
189
|
+
execFileSync(
|
|
190
|
+
'gemini',
|
|
191
|
+
['--resume', resumeTarget, '--include-directories', os.tmpdir(), `@${contextFile}`],
|
|
192
|
+
{ stdio: 'inherit', env: childEnv }
|
|
193
|
+
);
|
|
194
|
+
} else {
|
|
195
|
+
execFileSync(
|
|
196
|
+
'gemini',
|
|
197
|
+
['--include-directories', os.tmpdir(), `@${contextFile}`],
|
|
198
|
+
{ stdio: 'inherit', env: childEnv }
|
|
199
|
+
);
|
|
200
|
+
}
|
|
178
201
|
}
|
|
179
202
|
} catch (error) {
|
|
180
203
|
const isResume = mode === 'resume';
|