Skip to content

Add debug mode agent status logging #1150

@ulivz

Description

@ulivz

Description

Agent Server needs structured logging in debug mode to display complete agent runtime status through special log formats.

Expected Behavior

When logLevel: DEBUG is enabled, output structured logs containing:

  • Current execution status and SessionId
  • User task description
  • Current operation/phase
  • Final execution result

Current Behavior

Missing structured agent runtime status logs for debugging and monitoring.

Implementation Context

Relevant code locations:

  • multimodal/tarko/agent-server/src/core/AgentSession.ts - Session lifecycle and query execution
  • multimodal/tarko/agent-server/src/server.ts - Server configuration with isDebug flag
  • multimodal/tarko/agent-server/src/api/controllers/sessions.ts - Session management endpoints
// Current debug detection in server.ts
this.isDebug = appConfig.logLevel === LogLevel.DEBUG;

// Session execution in AgentSession.ts
async runQuery(query: string | ChatCompletionContentPart[]): Promise<AgentQueryResponse> {
  try {
    this.server.setRunningSession(this.id);
    // Add structured debug logging here
    const result = await this.agent.run(runOptions);
    return { success: true, result };
  } finally {
    this.server.clearRunningSession(this.id);
  }
}

Acceptance Criteria

  • Add structured debug logs for session lifecycle events
  • Log current execution status with SessionId
  • Include user task description in logs
  • Track current operation/phase during execution
  • Log final execution results
  • Use consistent log format for easy parsing
  • Only activate when logLevel: DEBUG is set

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions