MCPcopy Index your code
hub / github.com/coder/coder / StepFromContext

Function StepFromContext

coderd/x/chatd/chatdebug/context.go:62–68  ·  view source on GitHub ↗

StepFromContext returns the debug step context stored in ctx.

(ctx context.Context)

Source from the content-addressed store, hash-verified

60
61// StepFromContext returns the debug step context stored in ctx.
62func StepFromContext(ctx context.Context) (*StepContext, bool) {
63 sc, ok := ctx.Value(stepContextKey{}).(*StepContext)
64 if !ok {
65 return nil, false
66 }
67 return sc, true
68}
69
70// ReuseStep marks ctx so wrapped model calls under it share one debug step.
71func ReuseStep(ctx context.Context) context.Context {

Calls 1

ValueMethod · 0.45

Tested by 11

TestBeginStep_NilServiceFunction · 0.68
TestBeginStepReuseStepFunction · 0.68
TestDebugModel_DisabledFunction · 0.68
TestDebugModel_GenerateFunction · 0.68
TestDebugModel_StreamFunction · 0.68