MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / maybeFireSessionStart

Method maybeFireSessionStart

src/core/agent.ts:420–428  ·  view source on GitHub ↗

Fire SessionStart once per instance, stashing any injected context for * the first user message.

()

Source from the content-addressed store, hash-verified

418 /** Fire SessionStart once per instance, stashing any injected context for
419 * the first user message. */
420 private async maybeFireSessionStart(): Promise<void> {
421 if (this.sessionStarted) return
422 this.sessionStarted = true
423 if (!this.hooks.hasHooks("SessionStart")) return
424 const result = await this.hooks.run("SessionStart", {
425 source: this.options.resume ? "resume" : "startup",
426 })
427 if (result.additionalContext) this.pendingStartContext = result.additionalContext
428 }
429
430 /** Ask Stop hooks whether the turn should keep going. Forces at most one
431 * continuation per turn (stop_hook_active) so a hook can't loop forever. */

Callers 2

runTurnMethod · 0.95
compactMethod · 0.95

Calls 2

hasHooksMethod · 0.80
runMethod · 0.80

Tested by

no test coverage detected