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

Function ReuseStep

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

ReuseStep marks ctx so wrapped model calls under it share one debug step.

(ctx context.Context)

Source from the content-addressed store, hash-verified

69
70// ReuseStep marks ctx so wrapped model calls under it share one debug step.
71func ReuseStep(ctx context.Context) context.Context {
72 if holder, ok := reuseHolderFromContext(ctx); ok {
73 return context.WithValue(ctx, reuseStepKey{}, holder)
74 }
75 return context.WithValue(ctx, reuseStepKey{}, &reuseHolder{})
76}
77
78func reuseHolderFromContext(ctx context.Context) (*reuseHolder, bool) {
79 holder, ok := ctx.Value(reuseStepKey{}).(*reuseHolder)

Callers 4

RunFunction · 0.92
TestBeginStepReuseStepFunction · 0.85

Calls 1

reuseHolderFromContextFunction · 0.85