@cortexkit/opencode-magic-context 0.49.18 → 0.49.20
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/dist/auto-search-worker.js +53 -10
- package/dist/chunk-embedding-write-worker.js +30 -23
- package/dist/{compaction-marker-candidates-n4krhat4.js → compaction-marker-candidates-b2q30cft.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/compartment-chunk-embedding-va090as0.js +65 -0
- package/dist/config/schema/magic-context.d.ts +6 -6
- package/dist/{conflict-warning-hook-4pmz879v.js → conflict-warning-hook-frp3z2wk.js} +9 -8
- package/dist/{context-m897gfp9.js → context-mkece1db.js} +460 -135
- package/dist/{derive-budgets-zn7yzd2d.js → derive-budgets-pqybnx09.js} +2 -2
- package/dist/embedding-backfill-gy3p78py.js +25 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +5 -5
- package/dist/features/magic-context/chunk-embedding-writer.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +44 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts +3 -0
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts +11 -0
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts +3 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +2 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts +3 -0
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +1 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/local-embedding-pooling.d.ts +22 -0
- package/dist/features/magic-context/memory/local-embedding-pooling.d.ts.map +1 -0
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts +2 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +27 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +14 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/subagent-token-capture.d.ts +20 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/{history-owner-xp3pngv7.js → history-owner-36wp3mkb.js} +2 -2
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-embed-session.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-hint.d.ts +7 -1
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts +33 -6
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-evaluation.fixture.d.ts +2 -0
- package/dist/hooks/magic-context/auto-search-worker-evaluation.fixture.d.ts.map +1 -0
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +5 -2
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +5 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/diagnostic-log-state.d.ts +4 -0
- package/dist/hooks/magic-context/diagnostic-log-state.d.ts.map +1 -0
- package/dist/hooks/magic-context/execute-reclaim.d.ts +35 -0
- package/dist/hooks/magic-context/execute-reclaim.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +1 -3
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/latest-assistant-turn.d.ts +8 -0
- package/dist/hooks/magic-context/latest-assistant-turn.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +5 -0
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts +13 -0
- package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts.map +1 -1
- package/dist/hooks/magic-context/nudge-evaluation-log.d.ts +3 -0
- package/dist/hooks/magic-context/nudge-evaluation-log.d.ts.map +1 -0
- package/dist/hooks/magic-context/pending-drop-eligibility.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +4 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-date-refresh.d.ts +15 -2
- package/dist/hooks/magic-context/system-date-refresh.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-sticky-date.d.ts +10 -0
- package/dist/hooks/magic-context/system-prompt-sticky-date.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-messages.d.ts +2 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +23 -6
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-bjcnntmz.js → index-0wthn7fp.js} +468 -18
- package/dist/{index-kq82mtg0.js → index-11zf2wwc.js} +3 -3
- package/dist/{index-b5vqckbw.js → index-153r2q6z.js} +314 -127
- package/dist/{index-v8awdgvd.js → index-1pefp8ar.js} +5 -5
- package/dist/{v2/server-beht37jy.js → index-1zx2pa5d.js} +1 -1
- package/dist/{index-ze7mvk54.js → index-2yhtnfcf.js} +75 -57
- package/dist/{index-cf74k5ak.js → index-305y133n.js} +4 -4
- package/dist/{index-s734jcsr.js → index-35qc6606.js} +9 -3
- package/dist/{index-x4njr8df.js → index-48stjd56.js} +105 -19
- package/dist/{index-24jbw52d.js → index-4n7w9rad.js} +6 -6
- package/dist/{index-kee4kn5j.js → index-4pnsgvfk.js} +1 -1
- package/dist/{v2/server-8cd2j99z.js → index-5kym00ag.js} +32 -13
- package/dist/{index-4s3t0nd0.js → index-616rsjrv.js} +2 -2
- package/dist/{index-e4xv8890.js → index-67nyj0gy.js} +507 -210
- package/dist/{index-6x57ar45.js → index-adk2z5d8.js} +3 -3
- package/dist/{index-c5pytzne.js → index-b88dwwrh.js} +1 -1
- package/dist/{index-rr2bb45z.js → index-c4b76d4t.js} +2 -2
- package/dist/{index-nj7yykkx.js → index-c7phnbvk.js} +1 -1
- package/dist/index-cpjk5jd2.js +82 -0
- package/dist/{index-6s5941tm.js → index-d6rp4dxh.js} +5 -5
- package/dist/{index-s7j8tvhv.js → index-dc8hy95c.js} +69 -17
- package/dist/{index-j75v2476.js → index-h7tgn49j.js} +12 -15
- package/dist/{index-ke416mdc.js → index-j76ah6d7.js} +2 -2
- package/dist/{index-r4nkrs05.js → index-jfh3cktr.js} +4 -4
- package/dist/{index-a6mc0v4d.js → index-jmycsey7.js} +3 -3
- package/dist/{index-24fezq97.js → index-jr5na10t.js} +4 -4
- package/dist/{index-s74zqahq.js → index-kc9pn495.js} +4 -4
- package/dist/{index-p5y3k4g7.js → index-nda0zgna.js} +2 -1
- package/dist/{index-jn12fvvh.js → index-neb2jaed.js} +3 -3
- package/dist/{index-qn7xstt2.js → index-pnjwa6qa.js} +6 -7
- package/dist/{index-fgncb0ng.js → index-rmd0069m.js} +11 -11
- package/dist/{index-y9f76s3f.js → index-rrv26qjz.js} +1 -1
- package/dist/{index-v10f1rjv.js → index-spwjbkc7.js} +1 -1
- package/dist/{index-k29z4aqh.js → index-t5pck3ss.js} +1 -1
- package/dist/{index-936py2wm.js → index-t7hx3qcb.js} +361 -113
- package/dist/{index-s1ex9y6p.js → index-v7r4td4c.js} +464 -79
- package/dist/{index-2vxtcb95.js → index-vkc1ca9p.js} +2 -2
- package/dist/{index-rmwykbbb.js → index-x4k3f4mf.js} +33 -10
- package/dist/{index-bp5083x2.js → index-x9k3mqrf.js} +1 -1
- package/dist/{index-n37sebck.js → index-y4a3nhtk.js} +1 -1
- package/dist/index.js +57 -50
- package/dist/{logger-jm3sqqzr.js → logger-94kew5wm.js} +1 -1
- package/dist/{message-fts-rowid-map-17s0dfn4.js → message-fts-rowid-map-22tevnnj.js} +6 -5
- package/dist/{message-index-66jv6fh4.js → message-index-5qxcz6h7.js} +16 -15
- package/dist/{message-index-bounded-n1frdn85.js → message-index-bounded-n0m0t7tv.js} +16 -15
- package/dist/{message-time-backfill-73mmm76q.js → message-time-backfill-0myx7fz3.js} +3 -3
- package/dist/migration-worker.js +13 -12
- package/dist/{model-resolution-nx97z3x7.js → model-resolution-280gmqvd.js} +1 -1
- package/dist/plugin/embedding-bootstrap.d.ts +3 -1
- package/dist/plugin/embedding-bootstrap.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +8 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/subagent-tool-policy.d.ts +9 -0
- package/dist/plugin/subagent-tool-policy.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/{project-embedding-registry-z74mhqkf.js → project-embedding-registry-s2pqgec9.js} +13 -12
- package/dist/raw-ordinal-warmup-worker.js +136 -101
- package/dist/{read-session-chunk-v06g3vka.js → read-session-chunk-0a8vdyqp.js} +11 -10
- package/dist/{read-session-raw-rsc8c7qy.js → read-session-raw-y5cszf0b.js} +4 -3
- package/dist/recomp-orchestrator-61vyha9j.js +62 -0
- package/dist/{safe-notification-target-1szv1k5k.js → safe-notification-target-mkr9yzvr.js} +2 -2
- package/dist/{search-archive-4d53y23e.js → search-archive-8q9s49p5.js} +12 -11
- package/dist/{search-nkf271d4.js → search-v1y9ejws.js} +25 -24
- package/dist/{send-session-notification-6ve0e8p4.js → send-session-notification-0k6qzydk.js} +7 -6
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/model-resolution.d.ts +2 -0
- package/dist/shared/model-resolution.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts +30 -1
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/prompt-async-transport.d.ts +3 -0
- package/dist/shared/prompt-async-transport.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +7 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/sqlite.d.ts +1 -1
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/subagent-runner.d.ts +2 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/shared/worker-shutdown.d.ts +68 -0
- package/dist/shared/worker-shutdown.d.ts.map +1 -0
- package/dist/shared/worker-shutdown.fixture.d.ts +2 -0
- package/dist/shared/worker-shutdown.fixture.d.ts.map +1 -0
- package/dist/{sqlite-zf72c52d.js → sqlite-1rpvw2rj.js} +1 -1
- package/dist/{storage-memory-y3qmy00r.js → storage-memory-nm7v82mj.js} +2 -2
- package/dist/{storage-tags-r7k9tjcv.js → storage-tags-r6nk29n4.js} +5 -5
- package/dist/{task-config-x3qmayd2.js → task-config-t6bpyka7.js} +2 -2
- package/dist/tools/ctx-expand/rust-mode-tag.test-support.d.ts +15 -0
- package/dist/tools/ctx-expand/rust-mode-tag.test-support.d.ts.map +1 -0
- package/dist/tools/ctx-expand/tools.d.ts +11 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-zpgav0h7.js → transform-postprocess-phase-vtrgb7m6.js} +34 -31
- package/dist/v2/auto-search-worker.js +53 -10
- package/dist/v2/chunk-embedding-write-worker.js +30 -23
- package/dist/v2/{compaction-marker-candidates-ebx3388k.js → compaction-marker-candidates-cfab70cs.js} +3 -3
- package/dist/v2/compaction-marker-candidates-worker.js +2 -2
- package/dist/v2/compartment-chunk-embedding-nbdqx1td.js +64 -0
- package/dist/v2/{context-f2xh7ba4.js → context-cc33tv2z.js} +1259 -404
- package/dist/v2/{derive-budgets-2zh4gm2c.js → derive-budgets-knf763tt.js} +3 -3
- package/dist/v2/embedding-backfill-yxv2h5mc.js +24 -0
- package/dist/v2/embedding-worker-process.js +2 -2
- package/dist/v2/embedding-worker.js +5 -5
- package/dist/v2/hidden-child-record.d.ts +2 -0
- package/dist/v2/hidden-child-record.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts +2 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hidden-model-activity.d.ts +7 -0
- package/dist/v2/hidden-model-activity.d.ts.map +1 -0
- package/dist/v2/{history-owner-42e16w0n.js → history-owner-ad0crnrn.js} +2 -2
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/generate.d.ts +36 -1
- package/dist/v2/hooks/generate.d.ts.map +1 -1
- package/dist/v2/hooks/lkg-system.d.ts +35 -4
- package/dist/v2/hooks/lkg-system.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts +16 -1
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/tools.d.ts.map +1 -1
- package/dist/v2/{logger-7qt02bnb.js → logger-p34mjtja.js} +1 -1
- package/dist/v2/{message-fts-rowid-map-wfx67gfd.js → message-fts-rowid-map-dg12wymk.js} +6 -5
- package/dist/v2/{message-index-bounded-w3hfm29z.js → message-index-bounded-f4e01xk0.js} +16 -15
- package/dist/v2/{message-index-48f7hw7a.js → message-index-ydzrp6y6.js} +16 -15
- package/dist/v2/{message-time-backfill-04t0km1z.js → message-time-backfill-ddh8n9gy.js} +3 -3
- package/dist/v2/migration-worker.js +13 -12
- package/dist/v2/{model-resolution-nx97z3x7.js → model-resolution-280gmqvd.js} +1 -1
- package/dist/v2/{project-embedding-registry-gnkj56xp.js → project-embedding-registry-deza9ksw.js} +13 -12
- package/dist/v2/raw-ordinal-warmup-worker.js +136 -101
- package/dist/v2/{read-session-chunk-zpgmxwte.js → read-session-chunk-8cxfagky.js} +11 -10
- package/dist/v2/{read-session-raw-yaegtjzh.js → read-session-raw-1nrrecvx.js} +4 -3
- package/dist/v2/recomp-orchestrator-47m4hv5g.js +61 -0
- package/dist/v2/{safe-notification-target-qg7n2s77.js → safe-notification-target-khnzg57c.js} +2 -2
- package/dist/v2/{search-archive-vv48s2aa.js → search-archive-e80cvc09.js} +12 -11
- package/dist/v2/{search-kza414f0.js → search-fjz746zr.js} +25 -24
- package/dist/v2/{send-session-notification-3pxn658x.js → send-session-notification-nwvrv34d.js} +7 -6
- package/dist/v2/{server-8by8qfec.js → server-0epqaxhd.js} +75 -57
- package/dist/v2/{server-pwv4ezb0.js → server-168pb207.js} +1 -1
- package/dist/v2/{server-h0410h0v.js → server-1bw1wcbp.js} +1 -1
- package/dist/{index-beht37jy.js → v2/server-1zx2pa5d.js} +1 -1
- package/dist/v2/{server-a9xqj88f.js → server-230fnbws.js} +4 -4
- package/dist/v2/{server-tbe1femw.js → server-29qp8nz4.js} +1 -1
- package/dist/v2/{server-tgnbmwah.js → server-3mz2qh5a.js} +1 -1
- package/dist/v2/{server-hy3d3vsx.js → server-4nw4fqhr.js} +2 -2
- package/dist/v2/{server-qv7f0hhe.js → server-4sxjs6hn.js} +5 -5
- package/dist/v2/{server-34kwfsr4.js → server-53eh1r8r.js} +2 -2
- package/dist/v2/{server-xj136kt8.js → server-55rgxfrw.js} +9 -3
- package/dist/v2/{server-nj659894.js → server-5arr9ecn.js} +2 -2
- package/dist/{index-8cd2j99z.js → v2/server-5kym00ag.js} +32 -13
- package/dist/v2/{server-2ehj0bw7.js → server-63fqdghs.js} +106 -20
- package/dist/v2/{server-f2xf5gcb.js → server-6495nmn9.js} +12 -15
- package/dist/v2/{server-qd11g795.js → server-92g7d776.js} +2 -1
- package/dist/v2/{server-gpvay0xz.js → server-9x0kmta4.js} +6 -7
- package/dist/v2/{server-27gq4mfz.js → server-a3dwxfgd.js} +4 -4
- package/dist/v2/{server-6tmj0s7j.js → server-af2pght7.js} +3 -3
- package/dist/v2/{server-1wy7b9de.js → server-br1x0tev.js} +3 -3
- package/dist/v2/{server-n1prf1g6.js → server-brj8j2gk.js} +2 -2
- package/dist/v2/{server-bfpda1tb.js → server-c7dxxsj7.js} +466 -81
- package/dist/v2/server-cpjk5jd2.js +82 -0
- package/dist/v2/{server-g3qma5c0.js → server-dj7tz4ph.js} +2 -2
- package/dist/v2/{server-xhab8jx8.js → server-ej96a39v.js} +33 -10
- package/dist/v2/{server-6pmqg9m4.js → server-gyy4k6mf.js} +1 -1
- package/dist/v2/{server-a2eqhkxr.js → server-hqzyq8n4.js} +11 -11
- package/dist/v2/{server-h1v0pyxb.js → server-j4jnp9b5.js} +468 -18
- package/dist/v2/{server-da07v4xp.js → server-k3t06fxr.js} +1 -1
- package/dist/v2/{server-1nyybqan.js → server-m91f9m5s.js} +69 -17
- package/dist/v2/{server-rmygf5pn.js → server-ne8arh8t.js} +2 -2
- package/dist/v2/{server-my7k4eds.js → server-vn2nwcv6.js} +5 -5
- package/dist/v2/{server-46neh5fa.js → server-wyawsa88.js} +314 -127
- package/dist/v2/{server-zzkj2fch.js → server-xsryvyf6.js} +4 -4
- package/dist/v2/{server-n37sebck.js → server-y4a3nhtk.js} +1 -1
- package/dist/v2/{server-d04vrx0j.js → server-ygtykank.js} +2 -2
- package/dist/v2/server.js +6 -6
- package/dist/v2/{sqlite-zf72c52d.js → sqlite-1rpvw2rj.js} +1 -1
- package/dist/v2/{storage-memory-y3qmy00r.js → storage-memory-nm7v82mj.js} +2 -2
- package/dist/v2/{storage-tags-3wdb8zph.js → storage-tags-ss08kj5r.js} +5 -5
- package/dist/v2/store-reader.d.ts +8 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{task-config-nvz8mapa.js → task-config-7md27rx8.js} +2 -2
- package/dist/v2/{wrapup-orchestrator-psqz7yh0.js → wrapup-orchestrator-639whfhq.js} +32 -31
- package/dist/wrapup-orchestrator-mnvt2g8m.js +49 -0
- package/package.json +1 -1
- package/src/config/index.test.ts +28 -6
- package/src/shared/logger.test.ts +42 -1
- package/src/shared/logger.ts +11 -13
- package/src/shared/model-resolution.test.ts +67 -12
- package/src/shared/model-resolution.ts +43 -16
- package/src/shared/model-suggestion-retry.test.ts +166 -0
- package/src/shared/model-suggestion-retry.ts +165 -14
- package/src/shared/prompt-async-transport.test.ts +107 -0
- package/src/shared/prompt-async-transport.ts +86 -3
- package/src/shared/rpc-types.ts +7 -0
- package/src/shared/sqlite-busy-budget-review.test.ts +6 -1
- package/src/shared/sqlite.ts +4 -2
- package/src/shared/subagent-runner.ts +2 -0
- package/src/shared/worker-shutdown-fence.test.ts +87 -0
- package/src/shared/worker-shutdown.fixture.ts +25 -0
- package/src/shared/worker-shutdown.test.ts +127 -0
- package/src/shared/worker-shutdown.ts +160 -0
- package/dist/embedding-backfill-fmz50tsy.js +0 -24
- package/dist/recomp-orchestrator-ghpk2dtq.js +0 -61
- package/dist/v2/embedding-backfill-7c7yr69y.js +0 -23
- package/dist/v2/recomp-orchestrator-4vfxej9t.js +0 -60
- package/dist/wrapup-orchestrator-s9zc5b00.js +0 -48
|
@@ -118,12 +118,22 @@ describe("model-resolution", () => {
|
|
|
118
118
|
// Inheritance is deliberately absent because a fallback model may not support the
|
|
119
119
|
// qualifier selected for the primary model.
|
|
120
120
|
expect(resolveHistorianModel(config, "opencode")).toEqual({
|
|
121
|
-
primary: {
|
|
122
|
-
|
|
121
|
+
primary: {
|
|
122
|
+
model: "open/primary",
|
|
123
|
+
qualifier: "primary-only",
|
|
124
|
+
sourceConfigKey: "historian.opencode.model",
|
|
125
|
+
},
|
|
126
|
+
fallbacks: [
|
|
127
|
+
{ model: "open/fallback", sourceConfigKey: "historian.opencode.fallback_models" },
|
|
128
|
+
],
|
|
123
129
|
});
|
|
124
130
|
expect(resolveHistorianModel(config, "pi")).toEqual({
|
|
125
|
-
primary: {
|
|
126
|
-
|
|
131
|
+
primary: {
|
|
132
|
+
model: "pi/primary",
|
|
133
|
+
qualifier: "high",
|
|
134
|
+
sourceConfigKey: "historian.pi.model",
|
|
135
|
+
},
|
|
136
|
+
fallbacks: [{ model: "pi/fallback", sourceConfigKey: "historian.pi.fallback_models" }],
|
|
127
137
|
});
|
|
128
138
|
});
|
|
129
139
|
|
|
@@ -143,12 +153,32 @@ describe("model-resolution", () => {
|
|
|
143
153
|
};
|
|
144
154
|
|
|
145
155
|
expect(resolveHistorianModel(config, "opencode")).toEqual({
|
|
146
|
-
primary: {
|
|
147
|
-
|
|
156
|
+
primary: {
|
|
157
|
+
model: "open/code",
|
|
158
|
+
qualifier: "oc-primary",
|
|
159
|
+
sourceConfigKey: "historian.opencode.model",
|
|
160
|
+
},
|
|
161
|
+
fallbacks: [
|
|
162
|
+
{
|
|
163
|
+
model: "open/fallback",
|
|
164
|
+
qualifier: "oc-fallback",
|
|
165
|
+
sourceConfigKey: "historian.opencode.fallback_models",
|
|
166
|
+
},
|
|
167
|
+
],
|
|
148
168
|
});
|
|
149
169
|
expect(resolveHistorianModel(config, "pi")).toEqual({
|
|
150
|
-
primary: {
|
|
151
|
-
|
|
170
|
+
primary: {
|
|
171
|
+
model: "pi/model",
|
|
172
|
+
qualifier: "high",
|
|
173
|
+
sourceConfigKey: "historian.pi.model",
|
|
174
|
+
},
|
|
175
|
+
fallbacks: [
|
|
176
|
+
{
|
|
177
|
+
model: "pi/fallback",
|
|
178
|
+
qualifier: "max",
|
|
179
|
+
sourceConfigKey: "historian.pi.fallback_models",
|
|
180
|
+
},
|
|
181
|
+
],
|
|
152
182
|
});
|
|
153
183
|
});
|
|
154
184
|
|
|
@@ -182,8 +212,18 @@ describe("model-resolution", () => {
|
|
|
182
212
|
};
|
|
183
213
|
|
|
184
214
|
expect(resolveHistorianModel(configured, "omp")).toEqual({
|
|
185
|
-
primary: {
|
|
186
|
-
|
|
215
|
+
primary: {
|
|
216
|
+
model: "omp/historian",
|
|
217
|
+
qualifier: "auto",
|
|
218
|
+
sourceConfigKey: "historian.omp.model",
|
|
219
|
+
},
|
|
220
|
+
fallbacks: [
|
|
221
|
+
{
|
|
222
|
+
model: "omp/historian-fallback",
|
|
223
|
+
qualifier: "max",
|
|
224
|
+
sourceConfigKey: "historian.omp.fallback_models",
|
|
225
|
+
},
|
|
226
|
+
],
|
|
187
227
|
});
|
|
188
228
|
expect(
|
|
189
229
|
resolveDreamerTaskModel({ config: configured, harness: "omp", task: "verify" }),
|
|
@@ -197,6 +237,7 @@ describe("model-resolution", () => {
|
|
|
197
237
|
expect(resolveHistorianModel(piFallback, "omp")?.primary).toEqual({
|
|
198
238
|
model: "pi/historian",
|
|
199
239
|
qualifier: "high",
|
|
240
|
+
sourceConfigKey: "historian.pi.model",
|
|
200
241
|
});
|
|
201
242
|
expect(
|
|
202
243
|
resolveDreamerTaskModel({ config: piFallback, harness: "omp", task: "verify" }),
|
|
@@ -245,8 +286,22 @@ describe("model-resolution", () => {
|
|
|
245
286
|
};
|
|
246
287
|
|
|
247
288
|
expect(resolveDreamerTaskModel({ config, harness: "opencode", task: "curate" })).toEqual({
|
|
248
|
-
primary: {
|
|
249
|
-
|
|
289
|
+
primary: {
|
|
290
|
+
model: "open/task",
|
|
291
|
+
qualifier: "task-variant",
|
|
292
|
+
sourceConfigKey: "dreamer.opencode.tasks.curate.model",
|
|
293
|
+
},
|
|
294
|
+
fallbacks: [
|
|
295
|
+
{
|
|
296
|
+
model: "open/bare",
|
|
297
|
+
sourceConfigKey: "dreamer.opencode.tasks.curate.fallback_models",
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
model: "open/qualified",
|
|
301
|
+
qualifier: "fb",
|
|
302
|
+
sourceConfigKey: "dreamer.opencode.tasks.curate.fallback_models",
|
|
303
|
+
},
|
|
304
|
+
],
|
|
250
305
|
schedule: "0 4 * * *",
|
|
251
306
|
timeoutMinutes: 12,
|
|
252
307
|
promotionThreshold: 3,
|
|
@@ -5,6 +5,8 @@ export interface ResolvedModelEntry {
|
|
|
5
5
|
model: string;
|
|
6
6
|
/** OpenCode variant or Pi thinking level, selected for the active entry only. */
|
|
7
7
|
qualifier?: string;
|
|
8
|
+
/** Config location that supplied this attempt, for accurate failure diagnostics. */
|
|
9
|
+
sourceConfigKey?: string;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export type ModelInput = string | ResolvedModelEntry;
|
|
@@ -35,6 +37,10 @@ function resolveHarnessBlock(
|
|
|
35
37
|
return asRecord(selected);
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
function sourceHarness(container: ConfigRecord | undefined, harness: ModelHarness): ModelHarness {
|
|
41
|
+
return harness === "omp" && container?.omp == null ? "pi" : harness;
|
|
42
|
+
}
|
|
43
|
+
|
|
38
44
|
/**
|
|
39
45
|
* Collapses the string and object spellings of a harness model entry into the
|
|
40
46
|
* same model identity. Qualifiers stay separate because they alter an attempt,
|
|
@@ -116,14 +122,20 @@ export function resolveHistorianModel(
|
|
|
116
122
|
const historian = asRecord(asRecord(config)?.historian);
|
|
117
123
|
const block = resolveHarnessBlock(historian, harness);
|
|
118
124
|
if (!block) return { fallbacks: [] };
|
|
125
|
+
const source = `historian.${sourceHarness(historian, harness)}`;
|
|
126
|
+
const primary = resolvePrimaryEntry({
|
|
127
|
+
entry: block.model,
|
|
128
|
+
defaultQualifier: block[harness === "opencode" ? "variant" : "thinking_level"],
|
|
129
|
+
harness,
|
|
130
|
+
});
|
|
131
|
+
const fallbacks = resolveFallbackEntries(block.fallback_models, harness);
|
|
119
132
|
|
|
120
133
|
return {
|
|
121
|
-
primary:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}),
|
|
126
|
-
fallbacks: resolveFallbackEntries(block.fallback_models, harness),
|
|
134
|
+
primary: primary ? { ...primary, sourceConfigKey: `${source}.model` } : undefined,
|
|
135
|
+
fallbacks: fallbacks.map((entry) => ({
|
|
136
|
+
...entry,
|
|
137
|
+
sourceConfigKey: `${source}.fallback_models`,
|
|
138
|
+
})),
|
|
127
139
|
};
|
|
128
140
|
}
|
|
129
141
|
|
|
@@ -171,19 +183,34 @@ export function resolveDreamerTaskModel(args: {
|
|
|
171
183
|
harnessBlock[args.harness === "opencode" ? "variant" : "thinking_level"] ??
|
|
172
184
|
normalizeModelEntry(harnessBlock.model, args.harness)?.qualifier;
|
|
173
185
|
const taskHasModel = taskBlock !== undefined && hasOwn(taskBlock, "model");
|
|
186
|
+
const taskHasFallbacks = taskBlock !== undefined && hasOwn(taskBlock, "fallback_models");
|
|
174
187
|
const primarySource = taskHasModel ? taskBlock?.model : harnessBlock.model;
|
|
175
|
-
const fallbackSource =
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
188
|
+
const fallbackSource = taskHasFallbacks
|
|
189
|
+
? taskBlock?.fallback_models
|
|
190
|
+
: harnessBlock.fallback_models;
|
|
191
|
+
const source = `dreamer.${sourceHarness(dreamer, args.harness)}`;
|
|
192
|
+
const primary = resolvePrimaryEntry({
|
|
193
|
+
entry: primarySource,
|
|
194
|
+
defaultQualifier: taskQualifier ?? harnessQualifier,
|
|
195
|
+
harness: args.harness,
|
|
196
|
+
});
|
|
197
|
+
const fallbacks = resolveFallbackEntries(fallbackSource, args.harness);
|
|
179
198
|
|
|
180
199
|
return {
|
|
181
|
-
primary:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
200
|
+
primary: primary
|
|
201
|
+
? {
|
|
202
|
+
...primary,
|
|
203
|
+
sourceConfigKey: taskHasModel
|
|
204
|
+
? `${source}.tasks.${args.task}.model`
|
|
205
|
+
: `${source}.model`,
|
|
206
|
+
}
|
|
207
|
+
: undefined,
|
|
208
|
+
fallbacks: fallbacks.map((entry) => ({
|
|
209
|
+
...entry,
|
|
210
|
+
sourceConfigKey: taskHasFallbacks
|
|
211
|
+
? `${source}.tasks.${args.task}.fallback_models`
|
|
212
|
+
: `${source}.fallback_models`,
|
|
213
|
+
})),
|
|
187
214
|
schedule: readString(schedulingTask?.schedule),
|
|
188
215
|
timeoutMinutes:
|
|
189
216
|
typeof taskBlock?.timeout_minutes === "number" ? taskBlock.timeout_minutes : undefined,
|
|
@@ -5,6 +5,8 @@ import { recordedGeminiQuotaMessages } from "../features/magic-context/dreamer/p
|
|
|
5
5
|
import { HiddenAgentStepLimit } from "../v2/hooks/hidden-child";
|
|
6
6
|
import {
|
|
7
7
|
getPromptFailureDetail,
|
|
8
|
+
noteModelActivityMonitored,
|
|
9
|
+
noteModelOutputReceived,
|
|
8
10
|
promptSyncWithModelSuggestionRetry,
|
|
9
11
|
promptSyncWithValidatedOutputRetry,
|
|
10
12
|
} from "./model-suggestion-retry";
|
|
@@ -833,3 +835,167 @@ test("timeout rejects an uncooperative carrier and aborts its child", async () =
|
|
|
833
835
|
clearTimeout(timer);
|
|
834
836
|
}
|
|
835
837
|
});
|
|
838
|
+
|
|
839
|
+
describe("first-output deadline", () => {
|
|
840
|
+
const primary = { providerID: "opencode", modelID: "free-model" };
|
|
841
|
+
type Behaviour = "silent" | "partial" | "answer" | "unmonitored";
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* A transport double that behaves per model. "silent" watches the child but the
|
|
845
|
+
* model never answers; "partial" streams something and then hangs; "unmonitored"
|
|
846
|
+
* hangs without ever reporting whether the model answered (the Pi and OpenCode 2
|
|
847
|
+
* carriers); "answer" completes at once.
|
|
848
|
+
*/
|
|
849
|
+
function modelTransport(behaviours: Record<string, Behaviour>) {
|
|
850
|
+
const calls: Array<{ model: string; startedAt: number }> = [];
|
|
851
|
+
const transport = Object.assign(
|
|
852
|
+
async (request: PromptCall & { signal?: AbortSignal }) => {
|
|
853
|
+
const model = request.body.model
|
|
854
|
+
? `${request.body.model.providerID}/${request.body.model.modelID}`
|
|
855
|
+
: "primary";
|
|
856
|
+
calls.push({ model, startedAt: Date.now() });
|
|
857
|
+
const behaviour = behaviours[model] ?? "answer";
|
|
858
|
+
if (behaviour === "answer") return;
|
|
859
|
+
if (behaviour === "silent") noteModelActivityMonitored(request.signal);
|
|
860
|
+
if (behaviour === "partial") noteModelOutputReceived(request.signal);
|
|
861
|
+
await new Promise<void>((_resolve, reject) =>
|
|
862
|
+
request.signal?.addEventListener("abort", () => reject(new Error("aborted"))),
|
|
863
|
+
);
|
|
864
|
+
},
|
|
865
|
+
{ childSessionId: "child-first-output" },
|
|
866
|
+
);
|
|
867
|
+
return { transport, calls };
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
async function run(
|
|
871
|
+
behaviours: Record<string, Behaviour>,
|
|
872
|
+
options: { timeoutMs: number; firstOutputTimeoutMs?: number; fallbackModels?: string[] },
|
|
873
|
+
) {
|
|
874
|
+
const { transport, calls } = modelTransport(behaviours);
|
|
875
|
+
const startedAt = Date.now();
|
|
876
|
+
let caught: unknown;
|
|
877
|
+
let result: Awaited<ReturnType<typeof promptSyncWithValidatedOutputRetry>> | undefined;
|
|
878
|
+
try {
|
|
879
|
+
result = await promptSyncWithValidatedOutputRetry(
|
|
880
|
+
createClient(mock(async () => ({}))),
|
|
881
|
+
createArgs(primary),
|
|
882
|
+
{
|
|
883
|
+
transport: transport as never,
|
|
884
|
+
timeoutMs: options.timeoutMs,
|
|
885
|
+
...(options.firstOutputTimeoutMs !== undefined
|
|
886
|
+
? { firstOutputTimeoutMs: options.firstOutputTimeoutMs }
|
|
887
|
+
: {}),
|
|
888
|
+
fallbackModels: options.fallbackModels ?? ["anthropic/claude-sonnet-5-5"],
|
|
889
|
+
fetchOutput: async () => "<classify></classify>",
|
|
890
|
+
validateOutput: (output: string) => output,
|
|
891
|
+
},
|
|
892
|
+
);
|
|
893
|
+
} catch (error) {
|
|
894
|
+
caught = error;
|
|
895
|
+
}
|
|
896
|
+
return { result, caught, calls, elapsedMs: Date.now() - startedAt };
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
test("a primary that streams nothing by the deadline moves on to the fallback", async () => {
|
|
900
|
+
const outcome = await run(
|
|
901
|
+
{ "opencode/free-model": "silent" },
|
|
902
|
+
{ timeoutMs: 2_000, firstOutputTimeoutMs: 40 },
|
|
903
|
+
);
|
|
904
|
+
expect(outcome.caught).toBeUndefined();
|
|
905
|
+
expect(outcome.result?.attempt.label).toBe("anthropic/claude-sonnet-5-5");
|
|
906
|
+
expect(outcome.calls.map((call) => call.model)).toEqual([
|
|
907
|
+
"opencode/free-model",
|
|
908
|
+
"anthropic/claude-sonnet-5-5",
|
|
909
|
+
]);
|
|
910
|
+
// The silent primary was cut at its first-output deadline, not its timeout.
|
|
911
|
+
expect(outcome.elapsedMs).toBeLessThan(1_000);
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
test("the unvalidated chain also moves on from a silent primary", async () => {
|
|
915
|
+
const { transport, calls } = modelTransport({ "opencode/free-model": "silent" });
|
|
916
|
+
await promptSyncWithModelSuggestionRetry(
|
|
917
|
+
createClient(mock(async () => ({}))),
|
|
918
|
+
createArgs(primary),
|
|
919
|
+
{
|
|
920
|
+
transport: transport as never,
|
|
921
|
+
timeoutMs: 2_000,
|
|
922
|
+
firstOutputTimeoutMs: 40,
|
|
923
|
+
fallbackModels: ["anthropic/claude-sonnet-5-5"],
|
|
924
|
+
},
|
|
925
|
+
);
|
|
926
|
+
expect(calls.map((call) => call.model)).toEqual([
|
|
927
|
+
"opencode/free-model",
|
|
928
|
+
"anthropic/claude-sonnet-5-5",
|
|
929
|
+
]);
|
|
930
|
+
});
|
|
931
|
+
|
|
932
|
+
test("a primary that produced output before timing out does not fall back", async () => {
|
|
933
|
+
const outcome = await run(
|
|
934
|
+
{ "opencode/free-model": "partial" },
|
|
935
|
+
{ timeoutMs: 120, firstOutputTimeoutMs: 20 },
|
|
936
|
+
);
|
|
937
|
+
expect((outcome.caught as Error).message).toBe("prompt timed out after 120ms");
|
|
938
|
+
expect(outcome.calls).toHaveLength(1);
|
|
939
|
+
expect(getPromptFailureDetail(outcome.caught)?.failureClass).toBe("provider_timeout");
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
test("a silent primary's time comes out of the fallback's timeout", async () => {
|
|
943
|
+
// The fallback is the last model, so it gets no first-output cut of its own;
|
|
944
|
+
// its timeout is what the silent primary left of the overall 300 ms.
|
|
945
|
+
const outcome = await run(
|
|
946
|
+
{ "opencode/free-model": "silent", "anthropic/claude-sonnet-5-5": "silent" },
|
|
947
|
+
{ timeoutMs: 300, firstOutputTimeoutMs: 100 },
|
|
948
|
+
);
|
|
949
|
+
const message = (outcome.caught as Error).message;
|
|
950
|
+
const fallbackTimeoutMs = Number(/prompt timed out after (\d+)ms$/.exec(message)?.[1]);
|
|
951
|
+
expect(outcome.calls).toHaveLength(2);
|
|
952
|
+
expect(fallbackTimeoutMs).toBeLessThanOrEqual(200);
|
|
953
|
+
expect(fallbackTimeoutMs).toBeGreaterThan(100);
|
|
954
|
+
expect(outcome.elapsedMs).toBeLessThan(300 + 150);
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
test("the last model in the chain is never cut for silence", async () => {
|
|
958
|
+
const outcome = await run(
|
|
959
|
+
{ "opencode/free-model": "silent" },
|
|
960
|
+
{ timeoutMs: 120, firstOutputTimeoutMs: 20, fallbackModels: [] },
|
|
961
|
+
);
|
|
962
|
+
expect((outcome.caught as Error).message).toBe("prompt timed out after 120ms");
|
|
963
|
+
expect(outcome.calls).toHaveLength(1);
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
test("a transport that cannot see model output keeps the plain timeout", async () => {
|
|
967
|
+
const outcome = await run(
|
|
968
|
+
{ "opencode/free-model": "unmonitored" },
|
|
969
|
+
{ timeoutMs: 120, firstOutputTimeoutMs: 20 },
|
|
970
|
+
);
|
|
971
|
+
expect((outcome.caught as Error).message).toBe("prompt timed out after 120ms");
|
|
972
|
+
expect(outcome.calls).toHaveLength(1);
|
|
973
|
+
});
|
|
974
|
+
|
|
975
|
+
test("a caller without a first-output deadline keeps timeouts final", async () => {
|
|
976
|
+
// The historian passes no first-output deadline: a silent model still ends
|
|
977
|
+
// its chain at the timeout, exactly as before.
|
|
978
|
+
const outcome = await run({ "opencode/free-model": "silent" }, { timeoutMs: 120 });
|
|
979
|
+
expect((outcome.caught as Error).message).toBe("prompt timed out after 120ms");
|
|
980
|
+
expect(outcome.calls).toHaveLength(1);
|
|
981
|
+
});
|
|
982
|
+
|
|
983
|
+
test("a caller without a first-output deadline still falls back on a provider failure", async () => {
|
|
984
|
+
const prompt = mock(async (args: PromptCall) => {
|
|
985
|
+
if (args.body.model?.providerID === "opencode")
|
|
986
|
+
throw new Error("429 Too Many Requests: quota exceeded");
|
|
987
|
+
return {};
|
|
988
|
+
});
|
|
989
|
+
const result = await promptSyncWithValidatedOutputRetry(
|
|
990
|
+
createClient(prompt),
|
|
991
|
+
createArgs(primary),
|
|
992
|
+
{
|
|
993
|
+
fallbackModels: ["anthropic/claude-sonnet-5-5"],
|
|
994
|
+
fetchOutput: async () => "summary",
|
|
995
|
+
validateOutput: (output: string) => output,
|
|
996
|
+
},
|
|
997
|
+
);
|
|
998
|
+
expect(result.attempt.label).toBe("anthropic/claude-sonnet-5-5");
|
|
999
|
+
expect(prompt).toHaveBeenCalledTimes(2);
|
|
1000
|
+
});
|
|
1001
|
+
});
|