Skip to content

Improve error logging for better debugging in gateway logs#13951

Open
arpankanwer wants to merge 5 commits intoopenclaw:mainfrom
arpankanwer:main
Open

Improve error logging for better debugging in gateway logs#13951
arpankanwer wants to merge 5 commits intoopenclaw:mainfrom
arpankanwer:main

Conversation

@arpankanwer
Copy link

@arpankanwer arpankanwer commented Feb 11, 2026

Fixes #13868

This pull request improves error logging for provider errors in the Pi Embedded Runner to ensure better visibility and debugging of issues in the gateway logs. The changes focus on capturing both general provider errors and specific HTTP errors with detailed context.

Enhanced error logging:

  • Added logging for non-failover provider errors in run.ts to ensure they are captured in gateway logs before being propagated to the user. The log includes provider, model, session key, and a truncated error message.
  • Added immediate logging of provider HTTP errors in run/attempt.ts when an error with HTTP status 400 or above is detected. The log records provider, model, session ID, run ID, HTTP status, error message, and error type for improved debugging.

Greptile Overview

Greptile Summary

Added comprehensive error logging to capture provider errors that weren't being logged before, improving visibility into gateway issues.

  • Logs non-failover provider errors in run.ts before throwing, capturing provider, model, session key, and truncated error text
  • Logs HTTP errors with status >= 400 in attempt.ts at the source, including provider, model, session/run IDs, HTTP status, error message, and error type

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes only add logging statements without modifying any control flow or error handling logic. Both logging additions are defensive and follow existing patterns in the codebase. The truncation to 2000 characters prevents log spam, and the logs provide valuable debugging context.
  • No files require special attention

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Copilot AI review requested due to automatic review settings February 11, 2026 08:02
@openclaw-barnacle openclaw-barnacle bot added the agents Agent runtime and tooling label Feb 11, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves observability for Pi Embedded Runner provider failures by adding structured error logs so gateway logs retain more context when provider calls fail.

Changes:

  • Add immediate logging for suspected provider HTTP errors during prompt submission in runEmbeddedAttempt.
  • Add fallback logging for non-failover provider errors in runEmbeddedPiAgent before rethrowing to the caller.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/agents/pi-embedded-runner/run/attempt.ts Logs provider HTTP errors (status ≥ 400) at the prompt submission source with run/session/provider/model context.
src/agents/pi-embedded-runner/run.ts Logs non-failover provider errors before propagating them to the user.

TWFBusiness added a commit to TWFBusiness/openclaw-tw that referenced this pull request Feb 11, 2026
- openclaw#14019: prevent cron jobs from skipping execution (nextRunAtMs regression)
- openclaw#13931: drain active agent turns before gateway restart
- openclaw#14023: filter skills watcher file types to prevent FD exhaustion
- openclaw#13983: use requested agentId for isolated cron job auth resolution
- openclaw#13956: fix Grok web search returning empty content (xAI Responses API)
- openclaw#14018: auto-remind AI to check workspace context files on session reset
- openclaw#13960: preserve structured config validation errors in UI
- openclaw#13951: improve provider error logging in gateway logs
- openclaw#14021: optional memory flush before manual /compact command

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provider API errors not logged in gateway.log

1 participant

Comments