komrad

read_logs

Read the lines komrad or the CLIs wrote about one agent, one of its hook runs' output, or the log of a language server over its task's checkout.

read-onlyidempotentMCP toolLog

Pass the returned cursor back to read only new lines.

Calling it#

curl -X POST http://127.0.0.1:8787/komrad.log.v1.LogService/ReadLogs \
  -H 'Content-Type: application/json' \
  -d '{
  "agent_id": "<agent_id>",
  "service": "<service>"
}'

Request#

ReadLogsRequest#

FieldTypeDescription
agent_iduuid*

The agent whose lines to read, by id.

one of*

The log to read.

serviceServiceLog

Which lines of the server log to read.

hook_run_iduuid

The hook run whose output to read, by the id list_log_sources returns. The hook run must be one of the agent's.

language_serverstring

not empty

The language server whose log to read, by the name list_log_sources returns.

cursorstring

The cursor from the previous response. Empty reads the newest lines.

limitint32

between 0 and 1000

The most lines to return. Zero returns up to 200.

patternstring

at most 256 characters

A Go regular expression each line must match. Empty matches every line. Only the last 64 MB of the log is searched.

Response#

ReadLogsResponse#

FieldTypeDescription
linesAgentLogLine[]

The lines, oldest first, as the log wrote them.

cursorstring

The cursor to pass back to read only lines written after these.

resetbool

Whether the log started over since the cursor. The lines before the reset are gone.

morebool

Whether more lines remain past the cursor, which another call returns at once.

Types#

AgentLogLine#

AgentLogLine is one line of an agent's log.

FieldTypeDescription
textstring

The line, exactly as the log holds it.

ServiceLog#

ServiceLog is which lines of the server log to read.

ValueDescription
SERVICE_LOG_KOMRAD

Komrad's own lines.

SERVICE_LOG_CLI

The records the agents' CLIs sent.