MCPcopy Create free account
hub / github.com/Roy3838/Observer / getIterationsForAgent

Method getIterationsForAgent

app/src/utils/IterationStore.ts:196–202  ·  view source on GitHub ↗
(agentId: string)

Source from the content-addressed store, hash-verified

194 // ---- Sync reads (current session, from memory; the UI polls these) -----------
195
196 public getIterationsForAgent(agentId: string): IterationData[] {
197 const sessionId = this.sessions.get(agentId)?.id;
198 if (!sessionId) return [];
199 return [...this.live.values()]
200 .filter(it => it.sessionId === sessionId)
201 .sort((a, b) => a.sessionIterationNumber - b.sessionIterationNumber);
202 }
203
204 public getToolsFromLastIteration(agentId: string): ToolCall[] {
205 return [...(this.getIterationsForAgent(agentId).at(-1)?.tools ?? [])];

Callers 8

thumbForFunction · 0.80
agentReportFunction · 0.80
registry.tsFile · 0.80
fetchIterationsFunction · 0.80
fetchCaptureFunction · 0.80
fetchCountFunction · 0.80

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected