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

Method RemainingUses

coderd/x/chatd/chatadvisor/runtime.go:112–122  ·  view source on GitHub ↗

RemainingUses reports how many advisor calls are still available for the current runtime.

()

Source from the content-addressed store, hash-verified

110// RemainingUses reports how many advisor calls are still available for the
111// current runtime.
112func (rt *Runtime) RemainingUses() int {
113 if rt == nil || rt.cfg.MaxUsesPerRun <= 0 {
114 return 0
115 }
116
117 remaining := int64(rt.cfg.MaxUsesPerRun) - rt.used.Load()
118 if remaining < 0 {
119 return 0
120 }
121 return int(remaining)
122}
123
124// MaxOutputTokens reports the resolved output-token cap applied to each
125// advisor call. NewRuntime validates that this value is positive and that

Callers 2

RunAdvisorMethod · 0.95
TestNewAdvisorRuntimeFunction · 0.80

Calls 1

LoadMethod · 0.45

Tested by 1

TestNewAdvisorRuntimeFunction · 0.64