Skip to content

Log the egress evidence an unexplained 429 needs - #171

Merged
tim-smart merged 2 commits into
mainfrom
agent/effect-bot/c93491690629
Oct 31, 2026
Merged

tim-smart merged 2 commits into
mainfrom
agent/effect-bot/c93491690629

Conversation

@effect-bot

Copy link
Copy Markdown
Contributor

Janitor's sandbox pushes hit two HTTP 429s that we can't explain after the fact. The egress proxy keeps no record of what upstream answered, and it doesn't record when it forwarded a request without a credential because the workspace couldn't be reached. This PR adds the two log lines that would tell those cases apart next time. Request behaviour doesn't change, and nothing is retried.

  • handleChatEgress logs one warning when a GitHub or Multica request comes back 401, 403, 429 or 5xx. The warning carries the method, host, path (no query string), the credential actually sent (read, write, multica or none) and the status. When present, it also carries x-github-request-id, retry-after, x-ratelimit-remaining, x-ratelimit-reset and x-ratelimit-resource. Session and turn ids come from the existing log annotations. The token, the body and the request headers are never logged.
  • makeEgressContext logs a warning with the query op and the reason when a tokens or multica control request fails. Before, that failure was swallowed and the request went out anonymously.

Tests are from the investigation commit 0fb33e4 and are unchanged.

Closes EFF-3200

Two red tests, no production change:

- handleChatEgress: a 4xx/5xx from GitHub on a credentialed request is
  logged once with method, host, path, the credential actually sent, the
  status, GitHub's request id and the retry-after / x-ratelimit-* headers,
  correlated by session and turn, and never the token. A 200 is not logged.
- makeEgressContext: a workspace control request that fails is logged with
  the query op and the reason, instead of silently forwarding the request
  with no credential.
- handleChatEgress logs one warning when GitHub or Multica answers 401,
  403, 429 or 5xx, with the method, host, path (no query string), the
  credential actually sent (read, write, multica or none), the status, and
  GitHub's request id, retry-after and x-ratelimit-* headers when present.
  The token, the body and the request headers never go into the log.
- makeEgressContext logs a warning, with the query op and the reason, when
  a failed tokens or multica control request means the request goes out
  with no credential.

Request behaviour doesn't change, and nothing is retried.
@tim-smart
tim-smart merged commit 5d2cb8c into main Oct 31, 2026
4 checks passed
@tim-smart
tim-smart deleted the agent/effect-bot/c93491690629 branch October 31, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants