MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / Latest

Function Latest

internal/debug/debug.go:199–211  ·  view source on GitHub ↗

Latest returns the most recent event that has a non-empty payload, or (zero, false) if the ring is empty or no event has a payload yet. Used by /debug show with no argument.

()

Source from the content-addressed store, hash-verified

197// (zero, false) if the ring is empty or no event has a payload yet.
198// Used by /debug show with no argument.
199func Latest() (Event, bool) {
200 mu.Lock()
201 defer mu.Unlock()
202 for i := len(events) - 1; i >= 0; i-- {
203 if events[i].Payload != "" {
204 return events[i], true
205 }
206 }
207 if len(events) == 0 {
208 return Event{}, false
209 }
210 return events[len(events)-1], true
211}
212
213func truncatePayload(p string) string {
214 if len(p) <= maxPayloadBytes {

Callers 2

cmdDebugShowFunction · 0.92

Calls

no outgoing calls

Tested by 1