kovence-cli 1.3.0 → 1.3.1
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 +5 -0
- package/package.json +1 -1
- package/src/agent/turn.js +1 -0
- package/src/cli/sinks.js +5 -0
- package/tools.js +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.1] - 2026-11-22
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- **Streaming `write_file` vs `ReadTracker`**: Tracked stream-prewritten files in `streamActiveWriteFiles` (`src/cli/sinks.js`, `src/agent/turn.js`, `tools.js`) so creating new files during live streaming no longer triggers a false-positive `"Read this file with read_file first"` error on final `write_file` execution, while still blocking unread pre-existing files.
|
|
14
|
+
|
|
10
15
|
## [1.3.0] - 2026-11-22
|
|
11
16
|
|
|
12
17
|
### Added & Changed
|
package/package.json
CHANGED
package/src/agent/turn.js
CHANGED
|
@@ -657,6 +657,7 @@ async function runToolCalls(state, toolCalls, sink, options = {}) {
|
|
|
657
657
|
skipPostEditCheck: true,
|
|
658
658
|
_permissionChecked: true,
|
|
659
659
|
streamCheckpointed: state.streamCheckpointed,
|
|
660
|
+
streamActiveWriteFiles: state.streamActiveWriteFiles || null,
|
|
660
661
|
signal: activeSignal,
|
|
661
662
|
saveSession: (s) => {
|
|
662
663
|
if (!state.noSession && state.paths && s) saveSession(s, state.paths);
|
package/src/cli/sinks.js
CHANGED
|
@@ -531,6 +531,8 @@ function createTuiSink(tui, state) {
|
|
|
531
531
|
|
|
532
532
|
fs.writeFileSync(absPath, "", "utf8");
|
|
533
533
|
fileCreated = true;
|
|
534
|
+
if (!state.streamActiveWriteFiles) state.streamActiveWriteFiles = new Set();
|
|
535
|
+
state.streamActiveWriteFiles.add(absPath);
|
|
534
536
|
} catch {}
|
|
535
537
|
}
|
|
536
538
|
|
|
@@ -679,6 +681,8 @@ function createTuiSink(tui, state) {
|
|
|
679
681
|
fs.writeFileSync(absPath, "", "utf8");
|
|
680
682
|
entry.fileCreated = true;
|
|
681
683
|
entry.absPath = absPath;
|
|
684
|
+
if (!state.streamActiveWriteFiles) state.streamActiveWriteFiles = new Set();
|
|
685
|
+
state.streamActiveWriteFiles.add(absPath);
|
|
682
686
|
if (Array.isArray(entry.pendingDiskChunks) && entry.pendingDiskChunks.length > 0) {
|
|
683
687
|
fs.appendFileSync(absPath, entry.pendingDiskChunks.join(""), "utf8");
|
|
684
688
|
entry.pendingDiskChunks = [];
|
|
@@ -751,6 +755,7 @@ function createTuiSink(tui, state) {
|
|
|
751
755
|
cleanupStreamWrite(toolIdx, revert = false) {
|
|
752
756
|
const entry = streamWriteBlocks.get(toolIdx);
|
|
753
757
|
if (!entry) return;
|
|
758
|
+
if (entry.absPath) state.streamActiveWriteFiles?.delete(entry.absPath);
|
|
754
759
|
if (revert && entry.absPath && entry.fileCreated) {
|
|
755
760
|
const workspaceRoot = state.workspaceRoot || process.cwd();
|
|
756
761
|
if (state.paths && state.streamCheckpointed?.has(entry.absPath)) {
|
package/tools.js
CHANGED
|
@@ -1192,7 +1192,13 @@ const TOOL_HANDLERS = {
|
|
|
1192
1192
|
const abs = resolvePath(filePath, root);
|
|
1193
1193
|
assertToolFileAccess(abs, "write_file", ctx);
|
|
1194
1194
|
const real = resolveRealWithMissingLeaf(abs);
|
|
1195
|
-
|
|
1195
|
+
const isStreamPreWritten =
|
|
1196
|
+
Boolean(ctx?.streamActiveWriteFiles?.has(real)) || Boolean(ctx?.streamActiveWriteFiles?.has(abs));
|
|
1197
|
+
if (!isStreamPreWritten) {
|
|
1198
|
+
ctx?.readTracker?.assertCanWriteOrEdit(real);
|
|
1199
|
+
}
|
|
1200
|
+
ctx?.streamActiveWriteFiles?.delete(real);
|
|
1201
|
+
ctx?.streamActiveWriteFiles?.delete(abs);
|
|
1196
1202
|
if (ctx?.paths && !ctx?.streamCheckpointed?.has(real) && !ctx?.streamCheckpointed?.has(abs))
|
|
1197
1203
|
recordCheckpoint({
|
|
1198
1204
|
sessionId: ctx.session?.id || "default",
|