picocode-core 0.9.158 → 0.9.159

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picocode-core",
3
- "version": "0.9.158",
3
+ "version": "0.9.159",
4
4
  "description": "The agent runtime behind pico: sessions, tools, subagents, MCP, memory, and model access",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/controller.js CHANGED
@@ -361,8 +361,12 @@ export function createController({ boot }) {
361
361
  )
362
362
  })
363
363
 
364
- function noteSystem(text, { wake, agentId, sessionId = state.session?.id, sessionFile = state.session?.file } = {}) {
365
- pendingSystemNotes.push({ text, wake, agentId, sessionId, sessionFile })
364
+ // a note for a session that has not started yet waits for its first
365
+ // message; `ensure` starts the session now so the note is persisted and
366
+ // in view before the first turn, not after it
367
+ function noteSystem(text, { wake, agentId, ensure = false, sessionId = state.session?.id, sessionFile = state.session?.file } = {}) {
368
+ if (ensure && !state.session && !state.busy) ensureSession()
369
+ pendingSystemNotes.push({ text, wake, agentId, sessionId: sessionId ?? state.session?.id, sessionFile: sessionFile ?? state.session?.file })
366
370
  flushSystemNotes()
367
371
  }
368
372