MCPcopy Create free account
hub / github.com/anomalyco/opencode / settle

Function settle

packages/core/src/session/run-coordinator.ts:51–65  ·  view source on GitHub ↗
(key: Key, entry: Entry<E>, exit: Exit.Exit<void, E>)

Source from the content-addressed store, hash-verified

49 }
50
51 const settle = (key: Key, entry: Entry<E>, exit: Exit.Exit<void, E>) => {
52 if (Exit.isSuccess(exit) && !entry.stopping && entry.pendingWake) {
53 entry.pendingWake = false
54 start(key, entry, false, true)
55 return
56 }
57
58 const successor = entry.pendingWake ? makeEntry() : undefined
59 if (successor === undefined) active.delete(key)
60 else {
61 active.set(key, successor)
62 start(key, successor, false, true)
63 }
64 Deferred.doneUnsafe(entry.done, exit)
65 }
66
67 const run = (key: Key): Effect.Effect<void, E> =>
68 Effect.uninterruptibleMask((restore) => {

Callers 1

startFunction · 0.70

Calls 4

makeEntryFunction · 0.85
startFunction · 0.70
deleteMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected