MCPcopy Index your code
hub / github.com/anomalyco/opencode / runActive

Function runActive

packages/opencode/test/server/httpapi-exercise/runner.ts:32–45  ·  view source on GitHub ↗
(options: Options, scenario: ActiveScenario)

Source from the content-addressed store, hash-verified

30}
31
32function runActive(options: Options, scenario: ActiveScenario) {
33 if (options.mode === "auth") return runAuth(scenario)
34
35 return withContext(options, scenario, "shared", (ctx) =>
36 Effect.gen(function* () {
37 yield* trace(options, scenario, "request start")
38 const result = yield* call(scenario, ctx)
39 yield* trace(options, scenario, `response ${result.status}`)
40 yield* trace(options, scenario, "expect start")
41 yield* scenario.expect(ctx, ctx.state, result)
42 yield* trace(options, scenario, "expect done")
43 }),
44 )
45}
46
47function runAuth(scenario: ActiveScenario) {
48 return Effect.gen(function* () {

Callers 1

runScenarioFunction · 0.85

Calls 4

callFunction · 0.90
runAuthFunction · 0.85
withContextFunction · 0.85
traceFunction · 0.70

Tested by

no test coverage detected