Skip to content

Commit 60376ca

Browse files
author
easonLiangWorldedtech
committed
fix(task): declare the observation registry on Task in this unit
The read tools record the observed on-disk version through task.observationRegistry, but the field was only declared in a later unit, so at this head the call dereferences undefined and the mocked e2e run fails on the read_file smoke tests. The registry is introduced by this unit, so the field belongs here. tsc clean on this unit, 11 observationRegistry tests pass, ESLint --max-warnings=0 clean.
1 parent 4e2de13 commit 60376ca

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/core/task/Task.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ import { buildNativeToolsArrayWithRestrictions } from "./build-tools"
111111
import { ToolRepetitionDetector } from "../tools/ToolRepetitionDetector"
112112
import { restoreTodoListForTask } from "../tools/UpdateTodoListTool"
113113
import { FileContextTracker } from "../context-tracking/FileContextTracker"
114+
import { ObservationRegistry } from "./observationRegistry"
114115
import { RooIgnoreController } from "../ignore/RooIgnoreController"
115116
import { RooProtectedController } from "../protect/RooProtectedController"
116117
import { type AssistantMessageContent, presentAssistantMessage } from "../assistant-message"
@@ -286,6 +287,10 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
286287
readonly instanceId: string
287288
readonly metadata: TaskMetadata
288289

290+
// The observed on-disk version of each file this task has read. Declared here so the
291+
// read tools can record it; a write guard later compares a token against this registry.
292+
readonly observationRegistry = new ObservationRegistry()
293+
289294
todoList?: TodoItem[]
290295

291296
readonly rootTask: Task | undefined = undefined

0 commit comments

Comments
 (0)