picocode-core 0.9.147 → 0.9.149

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/controller.js +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picocode-core",
3
- "version": "0.9.147",
3
+ "version": "0.9.149",
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
@@ -154,7 +154,12 @@ export function createController({ boot }) {
154
154
  }
155
155
 
156
156
  function ensureSession() {
157
- if (!state.session) state.session = (boot.ephemeral ? createEphemeralSession : createSession)({ cwd: boot.cwd, root: boot.root })
157
+ if (!state.session) {
158
+ state.session = (boot.ephemeral ? createEphemeralSession : createSession)({ cwd: boot.cwd, root: boot.root })
159
+ // the file exists from this moment; anyone tracking open sessions
160
+ // by file needs to hear about it
161
+ emit('session', state.session)
162
+ }
158
163
  while (state.persisted < state.events.length) {
159
164
  state.session.append(state.events[state.persisted])
160
165
  state.persisted++
@@ -673,7 +678,10 @@ export function createController({ boot }) {
673
678
  const pendingMessages = state.queued
674
679
  if (expeditedMessages.length > 0 || pendingMessages.length > 0) {
675
680
  set({ expedited: [], queued: [] })
676
- if (result.interrupted && !sendAfterToolTriggered) {
681
+ // an interrupt is the user taking the wheel: nothing pending may
682
+ // auto-send, expedited or not; it all returns to the composer
683
+ if (result.interrupted) {
684
+ sendAfterToolTriggered = false
677
685
  emit('input', [...expeditedMessages, ...pendingMessages].join('\n'))
678
686
  } else {
679
687
  const next = sendAfterToolTriggered ? expeditedMessages : [...expeditedMessages, ...pendingMessages]