fix(proxy): one event name per thing that actually failed - #94
Merged
Merged
Conversation
`tls.handshake_failed` was every failure interception could produce. Seven call
sites, four of which are not handshakes at all:
a WebSocket upgrade declined rather than half-relayed
an h2 session to the ORIGIN that would not open
an h2 session or stream faulting after it was up
a request or response body that would not decode (four of the seven)
and, buried among them, the one an operator most needs to recognise: the client
refusing the certificate orca presented.
That last case is why the name mattered. It happens on the CLIENT side of the
proxy, but "handshake failed" with an `h2 session:` prefix reads as a problem
between orca and the origin — so the operator goes looking at the network, the
upstream, the proxy variables. The remedy is on the other side of the
connection: this run's CA is not in the agent's trust store. Meanwhile nothing
from that host is recorded and the trace looks quiet rather than broken, which
is the failure mode `--tls-intercept` exists to prevent.
`InterceptFailure` now carries the kind the call site already knew, and each
kind gets the name it deserves:
client_handshake -> tls.handshake_failed + where the CA has to go
upstream_session -> tls.upstream_failed
session -> tls.session_error
body_opaque -> net.body_opaque + "the exchange is recorded"
upgrade_refused -> net.upgrade_refused
Driven for real, with an agent that trusts only Node's root store:
客户端 UNABLE_TO_VERIFY_LEAF_SIGNATURE
warn tls.handshake_failed host=api.anthropic.com port=443
cause="the agent refused the certificate orca presented — this run's CA
is not in its trust store"
effect="nothing from api.anthropic.com is being recorded; the trace will
simply be missing it"
next="trust the run CA in the agent: NODE_EXTRA_CA_CERTS,
REQUESTS_CA_BUNDLE, SSL_CERT_FILE, …"
The name is what people grep and alert on, so the name is what had to be true.
Nothing outside `tls-capture.ts` used the old one — no docs, no tests, no
contract — so this renames a diagnostic and nothing else.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🐳 OrcaCode Review
✅ No findings — nothing to flag in this PR. Great work!
OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 534 calls · 41.6M tokens · 99% cached
❤️ Share · Install OrcaCode Review
Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.
Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Orca-Code-Review — push 1
✅ no blocking findings
tls.handshake_failedwas every failure interception could produce. Seven call sites; four ofthem are not handshakes at all:
tls.handshake_failedtls.handshake_failedtls.handshake_failedtls.handshake_failedtls.handshake_failedWhy the last one is the reason to fix this
It happens on the client side of the proxy. But "handshake failed" with an
h2 session:prefix reads as a problem between orca and the origin — so the operator goes looking at the
network, the upstream, the proxy variables. The remedy is on the other side of the connection
entirely: this run's CA is not in the agent's trust store.
Meanwhile nothing from that host is recorded, and the trace looks quiet rather than broken —
which is the failure mode
--tls-interceptexists to prevent.The change
InterceptFailurecarries the kind the call site already knew, and each kind gets the name itdeserves:
body_opaqueis worth calling out: a body kept as it arrived is not a connection failure andloses nothing. Reporting it as a handshake sent people to the TLS layer for a non-problem.
Driven for real
An agent that trusts only Node's root store, pointed through
--tls-intercept:Before this change the same run said:
All five kinds were also exercised directly and each lands on its own event name.
Scope
The name is what people grep and alert on, so the name is what had to be true. Nothing outside
tls-capture.tsused the old one — no docs, no tests, no contract — so this renames a diagnosticand changes nothing else.
Suite: 10 failed / 2444 passed / 40 skipped, identical to a freshly measured
mainbaseline, nonew failures and none resolved.
prettier --check,tsc --build,scripts/conformance.mjs(63 events, 0 failures) and
scripts/fidelity.mjs --check(0 regressions) all clean.The four new tests fail on
mainfor the right reason —reportInterceptFailuredoes not existthere yet.
🤖 Generated with Claude Code