@link-assistant/agent 0.8.13 → 0.8.15
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/package.json +1 -1
- package/src/cli/continuous-mode.js +4 -0
- package/src/flag/flag.ts +19 -0
- package/src/index.js +5 -0
- package/src/session/prompt.ts +4 -0
package/package.json
CHANGED
|
@@ -391,6 +391,8 @@ export async function runContinuousServerMode(
|
|
|
391
391
|
waitForPending();
|
|
392
392
|
}
|
|
393
393
|
}, 100);
|
|
394
|
+
// Allow process to exit naturally when no other work remains
|
|
395
|
+
checkRunning.unref();
|
|
394
396
|
|
|
395
397
|
// Also handle SIGINT
|
|
396
398
|
process.on('SIGINT', () => {
|
|
@@ -608,6 +610,8 @@ export async function runContinuousDirectMode(
|
|
|
608
610
|
waitForPending();
|
|
609
611
|
}
|
|
610
612
|
}, 100);
|
|
613
|
+
// Allow process to exit naturally when no other work remains
|
|
614
|
+
checkRunning.unref();
|
|
611
615
|
|
|
612
616
|
// Also handle SIGINT
|
|
613
617
|
process.on('SIGINT', () => {
|
package/src/flag/flag.ts
CHANGED
|
@@ -63,6 +63,25 @@ export namespace Flag {
|
|
|
63
63
|
'OPENCODE_DRY_RUN'
|
|
64
64
|
);
|
|
65
65
|
|
|
66
|
+
// Stream timeout configuration
|
|
67
|
+
// chunkMs: timeout between stream chunks - detects stalled streams (default: 2 minutes)
|
|
68
|
+
// stepMs: timeout for each individual LLM step (default: 10 minutes)
|
|
69
|
+
export function STREAM_CHUNK_TIMEOUT_MS(): number {
|
|
70
|
+
const val = getEnv(
|
|
71
|
+
'LINK_ASSISTANT_AGENT_STREAM_CHUNK_TIMEOUT_MS',
|
|
72
|
+
'AGENT_STREAM_CHUNK_TIMEOUT_MS'
|
|
73
|
+
);
|
|
74
|
+
return val ? parseInt(val, 10) : 120_000;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function STREAM_STEP_TIMEOUT_MS(): number {
|
|
78
|
+
const val = getEnv(
|
|
79
|
+
'LINK_ASSISTANT_AGENT_STREAM_STEP_TIMEOUT_MS',
|
|
80
|
+
'AGENT_STREAM_STEP_TIMEOUT_MS'
|
|
81
|
+
);
|
|
82
|
+
return val ? parseInt(val, 10) : 600_000;
|
|
83
|
+
}
|
|
84
|
+
|
|
66
85
|
// Compact JSON mode - output JSON on single lines (NDJSON format)
|
|
67
86
|
// Enabled by AGENT_CLI_COMPACT env var or --compact-json flag
|
|
68
87
|
// Uses getter to check env var at runtime for tests
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
+
// Set process title to 'agent' so it appears correctly in process monitoring tools like top/ps
|
|
4
|
+
// Both process.title and process.argv0 need to be set for maximum compatibility
|
|
5
|
+
process.title = 'agent';
|
|
6
|
+
process.argv0 = 'agent';
|
|
7
|
+
|
|
3
8
|
import { Server } from './server/server.ts';
|
|
4
9
|
import { Instance } from './project/instance.ts';
|
|
5
10
|
import { Log } from './util/log.ts';
|
package/src/session/prompt.ts
CHANGED
|
@@ -613,6 +613,10 @@ export namespace SessionPrompt {
|
|
|
613
613
|
|
|
614
614
|
const result = await processor.process(() =>
|
|
615
615
|
streamText({
|
|
616
|
+
timeout: {
|
|
617
|
+
chunkMs: Flag.STREAM_CHUNK_TIMEOUT_MS(),
|
|
618
|
+
stepMs: Flag.STREAM_STEP_TIMEOUT_MS(),
|
|
619
|
+
},
|
|
616
620
|
onError(error) {
|
|
617
621
|
log.error(() => ({ message: 'stream error', error }));
|
|
618
622
|
},
|