@dreb/coding-agent 2.66.1 → 2.66.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.
@@ -1134,6 +1134,10 @@ export class AgentSession {
1134
1134
  get state() {
1135
1135
  return this.agent.state;
1136
1136
  }
1137
+ /** Effective runtime working directory used by tools, resources, and project discovery. */
1138
+ get cwd() {
1139
+ return this._cwd;
1140
+ }
1137
1141
  /** Current session task list (read-only) */
1138
1142
  get tasks() {
1139
1143
  return this._tasks;
@@ -1759,7 +1763,7 @@ export class AgentSession {
1759
1763
  await this.abort();
1760
1764
  this.agent.reset();
1761
1765
  this._dispatchArbiter.clearContext();
1762
- this.sessionManager.newSession({ parentSession: options?.parentSession });
1766
+ this.sessionManager.newSession({ parentSession: options?.parentSession, cwd: this.cwd });
1763
1767
  this.agent.sessionId = this.sessionManager.getSessionId();
1764
1768
  this._steeringMessages = [];
1765
1769
  this._followUpMessages = [];
@@ -3269,7 +3273,7 @@ export class AgentSession {
3269
3273
  throw new Error("Cannot fork at this assistant turn: it was interrupted or is still waiting on tool results");
3270
3274
  }
3271
3275
  const { cancelled } = await this._performFork(entryId, () => {
3272
- this.sessionManager.createBranchedSession(entryId);
3276
+ this.sessionManager.createBranchedSession(entryId, this.cwd);
3273
3277
  });
3274
3278
  return { selectedText: "", cancelled };
3275
3279
  }
@@ -3279,10 +3283,10 @@ export class AgentSession {
3279
3283
  // offered as editor pre-fill.
3280
3284
  const { cancelled } = await this._performFork(entryId, (previousSessionFile) => {
3281
3285
  if (!selectedEntry.parentId) {
3282
- this.sessionManager.newSession({ parentSession: previousSessionFile });
3286
+ this.sessionManager.newSession({ parentSession: previousSessionFile, cwd: this.cwd });
3283
3287
  }
3284
3288
  else {
3285
- this.sessionManager.createBranchedSession(selectedEntry.parentId);
3289
+ this.sessionManager.createBranchedSession(selectedEntry.parentId, this.cwd);
3286
3290
  }
3287
3291
  });
3288
3292
  return { selectedText, cancelled };