MCPcopy
hub / github.com/IBM/AssetOpsBench / _close_step

Function _close_step

src/agent/opencode_agent/runner.py:444–456  ·  view source on GitHub ↗
(input_tokens: int, output_tokens: int)

Source from the content-addressed store, hash-verified

442 pending_tools: list[str] = []
443
444 def _close_step(input_tokens: int, output_tokens: int) -> None:
445 if not (pending_text or pending_tools or input_tokens or output_tokens):
446 return
447 steps.append(
448 {
449 "text_ids": list(pending_text),
450 "tool_ids": list(pending_tools),
451 "input_tokens": input_tokens,
452 "output_tokens": output_tokens,
453 }
454 )
455 pending_text.clear()
456 pending_tools.clear()
457
458 for index, event in enumerate(events):
459 part = _candidate_part(event)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected