picocode-core 0.9.130 → 0.9.132

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 +23 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "picocode-core",
3
- "version": "0.9.130",
3
+ "version": "0.9.132",
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
@@ -108,6 +108,7 @@ export function createController({ boot }) {
108
108
  defaultEffort: boot.initialEffort,
109
109
  busy: false,
110
110
  compacting: false,
111
+ compactOutcome: null,
111
112
  compactStatus: null,
112
113
  turnPhase: 'idle',
113
114
  startedAt: 0,
@@ -385,7 +386,7 @@ export function createController({ boot }) {
385
386
 
386
387
  const controller = new AbortController()
387
388
  abort = controller
388
- set({ busy: true, compacting: true, compactStatus: null, startedAt: Date.now() })
389
+ set({ busy: true, compacting: true, compactStatus: null, compactOutcome: null, startedAt: Date.now() })
389
390
 
390
391
  const { auth, ok } = await codexAuth()
391
392
  if (!ok) {
@@ -414,8 +415,10 @@ export function createController({ boot }) {
414
415
  if (summarySections(summary) < 5) throw new Error('malformed summary, conversation left untouched')
415
416
  persist(makeEvent('compact', { summary, keepFrom, sessionFile: state.session?.file || null }))
416
417
  reDerive()
418
+ set({ compactOutcome: 'done' })
417
419
  flash('compacted · recent messages kept verbatim')
418
420
  } catch (err) {
421
+ set({ compactOutcome: controller.signal.aborted ? 'cancelled' : 'failed' })
419
422
  if (controller.signal.aborted) flash('compaction cancelled')
420
423
  else flash(`compact failed: ${errorText(err, 100)}`)
421
424
  } finally {
@@ -1002,6 +1005,23 @@ export function createController({ boot }) {
1002
1005
  send(text)
1003
1006
  }
1004
1007
 
1008
+ // the worker and deliberation models are app-wide settings: they change
1009
+ // for every session in this process and persist to the config file
1010
+ async function setResearchModel(name) {
1011
+ if (name && !modelAvailable(name)) return flash(`${name} is not available`)
1012
+ boot.researchModel = name || null
1013
+ if (!boot.deliberationModel || boot.deliberationModel === name) boot.deliberationModel = name || null
1014
+ await writeConfig({ models: { researchWorker: name || null } })
1015
+ changed()
1016
+ }
1017
+
1018
+ async function setDeliberationModel(name) {
1019
+ if (name && !modelAvailable(name)) return flash(`${name} is not available`)
1020
+ boot.deliberationModel = name || null
1021
+ await writeConfig({ models: { deliberation: name || null } })
1022
+ changed()
1023
+ }
1024
+
1005
1025
  function sendInit(args) {
1006
1026
  send(initPrompt(args))
1007
1027
  }
@@ -1263,6 +1283,8 @@ export function createController({ boot }) {
1263
1283
  sendSkill,
1264
1284
  sendCommand,
1265
1285
  sendInit,
1286
+ setResearchModel,
1287
+ setDeliberationModel,
1266
1288
  previewSteer,
1267
1289
  applySteer,
1268
1290
  rewind,