nightytidy 0.2.12 → 0.2.13
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/agent/index.js +7 -0
package/package.json
CHANGED
package/src/agent/index.js
CHANGED
|
@@ -79,6 +79,7 @@ export async function startAgent() {
|
|
|
79
79
|
let pauseRequested = false;
|
|
80
80
|
let skipCurrentStep = false;
|
|
81
81
|
let runOutputBuffer = ''; // Accumulated raw output for the current run
|
|
82
|
+
const MAX_OUTPUT_BUFFER = 512_000; // 512 KB cap — matches web app's RAW_OUTPUT_MAX_LENGTH
|
|
82
83
|
|
|
83
84
|
// Accumulated run state — survives page refreshes via get-run
|
|
84
85
|
let runProgress = {
|
|
@@ -615,6 +616,9 @@ export async function startAgent() {
|
|
|
615
616
|
|
|
616
617
|
const stepResult = await bridge.runStep(stepNum, (text) => {
|
|
617
618
|
runOutputBuffer += text;
|
|
619
|
+
if (runOutputBuffer.length > MAX_OUTPUT_BUFFER * 1.2) {
|
|
620
|
+
runOutputBuffer = runOutputBuffer.slice(-MAX_OUTPUT_BUFFER);
|
|
621
|
+
}
|
|
618
622
|
wsServer.broadcast({ type: 'step-output', runId: run.id, text, mode: 'raw' });
|
|
619
623
|
});
|
|
620
624
|
|
|
@@ -866,6 +870,9 @@ export async function startAgent() {
|
|
|
866
870
|
|
|
867
871
|
const stepResult = await bridge.runStep(stepNum, (text) => {
|
|
868
872
|
runOutputBuffer += text;
|
|
873
|
+
if (runOutputBuffer.length > MAX_OUTPUT_BUFFER * 1.2) {
|
|
874
|
+
runOutputBuffer = runOutputBuffer.slice(-MAX_OUTPUT_BUFFER);
|
|
875
|
+
}
|
|
869
876
|
wsServer.broadcast({ type: 'step-output', runId: interrupted.id, text, mode: 'raw' });
|
|
870
877
|
});
|
|
871
878
|
|