@noobdemon/noob-cli 1.12.12 → 1.12.14
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 +10 -0
- package/package.json +1 -1
- package/src/tui.js +1 -0
- package/src/workflow-bg.js +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Tất cả thay đổi đáng kể của `@noobdemon/noob-cli` được ghi vào file này.
|
|
4
4
|
|
|
5
|
+
## [1.12.14] - 2026-06-14
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Bg workflow sub-agent kẹt model cũ khi `/model` đổi giữa chừng** (`src/workflow-bg.js`): `startBgWorkflow` spread `{...state}` → snapshot `state.model` lúc spawn. User `/model` đổi sau khi bg run bắt đầu → sub-agent bg đẻ ra vẫn dùng model cũ thay vì CLI pick hiện tại. Fix: thay spread bằng `Object.create(state)` proto-delegate (chỉ override `workflowRun`) → dispatcher đọc `state.model.id` SỐNG mỗi lần spawn sub-agent, theo đúng model CLI đang chọn. Giới hạn còn lại: top-level bg run = 1 `runAgent` dài, model chốt lúc spawn (không swap mid-flight được); chỉ sub-agent track CLI sống. Foreground `spawn_agent` không đụng — đã đọc model sống sẵn. Smoke `workflow-bg` 6/6 pass.
|
|
9
|
+
|
|
10
|
+
## [1.12.13] - 2026-06-14
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- **DUMB-mode boot crash `tui.setTodos is not a function` (nghiêm trọng — non-TTY user chết ngay launch)** (`src/tui.js`): object TUI chế độ DUMB (non-TTY / `NOOB_TUI=0`: pipe, CI, terminal lạ) thiếu method `setTodos` — chỉ rich TTY object (tui.js:814) có. `startFresh` (repl.js:394) gọi `tui.setTodos([])` mỗi phiên mới → non-TTY nổ ngay. Bug có sẵn từ trước, lộ ra khi verify real-REPL bằng `NOOB_TUI=0`. Fix: thêm `setTodos() {}` no-op vào DUMB object, khớp full method set với rich object (print/status/setBusy/setMeta/setTodos/setPrompt/read/close/start). Verify: boot sạch cả 2 mode (TTY + NOOB_TUI=0), banner in + exit 0.
|
|
14
|
+
|
|
5
15
|
## [1.12.12] - 2026-06-14
|
|
6
16
|
|
|
7
17
|
### Fixed
|
package/package.json
CHANGED
package/src/tui.js
CHANGED
package/src/workflow-bg.js
CHANGED
|
@@ -78,8 +78,13 @@ export function createBgRegistry(deps = {}) {
|
|
|
78
78
|
|
|
79
79
|
// Headless dispatcher: own controller + meter, stub spinner/tui (bg không có UI).
|
|
80
80
|
const noop = () => {};
|
|
81
|
+
// Prototype-delegate tới state SỐNG: đọc model/agentMode… luôn lấy giá trị
|
|
82
|
+
// hiện tại (user /model giữa chừng → bg sub-agent theo CLI pick). Chỉ override
|
|
83
|
+
// workflowRun cho bg journal. KHÔNG spread (spread = snapshot model lúc spawn).
|
|
84
|
+
const bgState = Object.create(state);
|
|
85
|
+
bgState.workflowRun = bgWorkflowRun;
|
|
81
86
|
const dispatchTool = createAgentDispatcher({
|
|
82
|
-
state:
|
|
87
|
+
state: bgState,
|
|
83
88
|
abort: controller,
|
|
84
89
|
tokenMeter: meter,
|
|
85
90
|
stopSpin: noop,
|
|
@@ -91,6 +96,8 @@ export function createBgRegistry(deps = {}) {
|
|
|
91
96
|
|
|
92
97
|
// Chạy headless. runAgent options TUI-bound (onStatus/onDelta/onSteer) bỏ —
|
|
93
98
|
// đều optional, ?.-guard trong agent.js.
|
|
99
|
+
// Top-level bg run: model chốt lúc spawn (1 runAgent dài, không swap giữa
|
|
100
|
+
// chừng được). Sub-agent nó đẻ ra đọc model SỐNG qua bgState proto → theo CLI.
|
|
94
101
|
const history = [{ role: 'user', content: prompt }];
|
|
95
102
|
const promise = _runAgent({
|
|
96
103
|
history,
|