@code-yeongyu/senpi-codemode 2026.11.6-3 → 2026.11.9-2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [2026.11.9-2] - 2026-11-09
4
+
5
+ ### Breaking Changes
6
+
7
+ ### Added
8
+
9
+ ### Changed
10
+
11
+ ### Fixed
12
+
13
+ - A nested tool's streamed lines no longer vanish from a running eval cell's live update for one frame when the tool finishes; they stay until the cell's own output or its completion replaces them ([#6259](https://github.com/code-yeongyu/senpi/pull/6259)).
14
+
15
+ ### Removed
16
+
17
+ ## [2026.11.9] - 2026-11-09
18
+
19
+ ### Breaking Changes
20
+
21
+ ### Added
22
+
23
+ ### Changed
24
+
25
+ ### Fixed
26
+
27
+ ### Removed
28
+
3
29
  ## [2026.11.6-3] - 2026-11-08
4
30
 
5
31
  ### Breaking Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi-codemode",
3
- "version": "2026.11.6-3",
3
+ "version": "2026.11.9-2",
4
4
  "description": "Source-only senpi extension package for codemode evaluation tools",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -33,15 +33,15 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/parser": "8.0.4",
36
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.6-3",
36
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.11.9-2",
37
37
  "quickjs-wasi": "3.6.2",
38
38
  "typebox": "1.3.34"
39
39
  },
40
40
  "peerDependencies": {
41
- "@code-yeongyu/senpi": "2026.11.6-3"
41
+ "@code-yeongyu/senpi": "2026.11.9-2"
42
42
  },
43
43
  "devDependencies": {
44
- "@code-yeongyu/senpi": "2026.11.6-3"
44
+ "@code-yeongyu/senpi": "2026.11.9-2"
45
45
  },
46
46
  "keywords": [
47
47
  "senpi",
@@ -73,6 +73,7 @@ export class CellResultBuilder implements CellToolUpdateSink {
73
73
  ...(options.artifactPath === undefined ? {} : { artifactPath: options.artifactPath }),
74
74
  ...(options.imageResizer === undefined ? {} : { imageResizer: options.imageResizer }),
75
75
  onChunk: (chunk) => {
76
+ this.#nestedTools.releaseSettled();
76
77
  this.#liveLines.append(chunk);
77
78
  this.#scheduleOutputUpdate();
78
79
  },
@@ -127,11 +128,15 @@ export class CellResultBuilder implements CellToolUpdateSink {
127
128
  this.#scheduleOutputUpdate();
128
129
  }
129
130
 
131
+ /** Settling changes nothing on screen (the call's lines stay until the cell replaces them), so it emits nothing. */
130
132
  nestedToolSettled(callId: string): void {
131
- if (this.dropNestedTool(callId)) this.#scheduleOutputUpdate();
133
+ this.dropNestedTool(callId);
132
134
  }
133
135
 
134
- /** Removes a settled call's partial from the live view without emitting; the caller's next update shows it gone. */
136
+ /**
137
+ * Marks a call settled without emitting: its lines stay in the live view until the cell's own next output or its
138
+ * completion replaces them (#6257).
139
+ */
135
140
  dropNestedTool(callId: string): boolean {
136
141
  if (!this.#nestedTools.drop(callId)) return false;
137
142
  this.#state.output = this.#liveCellOutput();
@@ -13,27 +13,51 @@ export interface CellToolUpdateSink {
13
13
  */
14
14
  export class NestedToolOutput {
15
15
  readonly #byCall = new Map<string, string>();
16
+ /**
17
+ * The newest settled call's last text, still on screen until something replaces it: the cell's own output, a
18
+ * live call's next text, a later settled call, or the cell's completion (#6257). Only one is held, so a cell
19
+ * that settles many calls without printing keeps one call's tail, not all of them.
20
+ */
21
+ #held: string | undefined;
16
22
 
17
23
  /** Keeps the call's newest partial; false when it adds no new text. */
18
24
  update(callId: string, partial: AgentToolResult<unknown>): boolean {
19
25
  const text = partial.content.flatMap((part) => (part.type === "text" ? [part.text] : [])).join("\n");
20
26
  if (text.length === 0 || this.#byCall.get(callId) === text) return false;
21
27
  this.#byCall.set(callId, text);
28
+ this.#held = undefined;
22
29
  return true;
23
30
  }
24
31
 
25
- /** Forgets a settled call; false when it never showed output. */
32
+ /**
33
+ * Marks a call settled; false when it never showed output. Its last text becomes the held text (replacing any
34
+ * earlier one) and stays in the live view until
35
+ * `releaseSettled` (the cell's own next output) or `clear` (the cell finished), so the user never sees the
36
+ * running cell with those lines gone and nothing in their place (#6257).
37
+ */
26
38
  drop(callId: string): boolean {
27
- return this.#byCall.delete(callId);
39
+ const text = this.#byCall.get(callId);
40
+ if (text === undefined) return false;
41
+ this.#byCall.delete(callId);
42
+ this.#held = text;
43
+ return true;
44
+ }
45
+
46
+ /** Removes the held settled text; false when none was held. */
47
+ releaseSettled(): boolean {
48
+ if (this.#held === undefined) return false;
49
+ this.#held = undefined;
50
+ return true;
28
51
  }
29
52
 
30
53
  clear(): void {
31
54
  this.#byCall.clear();
55
+ this.#held = undefined;
32
56
  }
33
57
 
34
58
  appendTo(output: string): string {
35
59
  let combined = output;
36
- for (const text of this.#byCall.values()) {
60
+ for (const text of this.#held === undefined ? this.#byCall.values() : [this.#held, ...this.#byCall.values()]) {
37
61
  const tail = truncateTailBytes(text, DEFAULT_MAX_BYTES).text;
38
62
  combined = combined.length === 0 || combined.endsWith("\n") ? `${combined}${tail}` : `${combined}\n${tail}`;
39
63
  }
@@ -42,7 +66,7 @@ export class NestedToolOutput {
42
66
 
43
67
  /** Like `appendTo`, kept to the last `maxLines` lines; `output` is returned untouched while no call shows output. */
44
68
  appendLines(output: string, maxLines: number): string {
45
- if (this.#byCall.size === 0) return output;
69
+ if (this.#byCall.size === 0 && this.#held === undefined) return output;
46
70
  const combined = this.appendTo(output);
47
71
  const hasTrailingNewline = combined.endsWith("\n");
48
72
  const lines = combined.split("\n");