picocode-core 0.9.130 → 0.9.131
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 +1 -1
- package/src/controller.js +4 -1
package/package.json
CHANGED
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 {
|