docs(protocol): correct depth-refusal contract to match live router behavior#65
Merged
Conversation
…ehavior
Investigation surfaced two doc inaccuracies the freshly-merged spec doc
inherited from my own assumption rather than measurement:
1. Refusal status code is 429 + body code 'bridge_depth_exceeded' (live
in tangle-router app/api/chat/route.ts:1390-1410), not the 413 the
spec claimed. Updated header table + invariant #5 accordingly.
2. The spec read as fully shipped end-to-end. Added an Implementation
status table making the per-layer reality explicit:
- agent-runtime emits all six headers (this is the work that
shipped in #64).
- tangle-router enforces depth + forwards auth (already live).
- cli-bridge forwards authorization to sandbox backends (already
live); does not enforce depth locally — inherits via router.
- agent-gateway middleware: NOT YET. Deferred to a real consumer.
No code changes. The agent-runtime headers builders and emitters are
already correct (they emit the header; refusal is the gateway's job).
The doc was the only thing out of step.
tangletools
approved these changes
May 26, 2026
Contributor
tangletools
left a comment
There was a problem hiding this comment.
APPROVE. Doc-only fix, 17 lines, no code changes. Verified the three factual claims against source:
tangle-router/app/api/chat/route.ts:1390-1410does refuse with HTTP 429 +bridge_depth_exceeded. ✓cli-bridge/src/routes/chat-completions.ts:190+212does readx-tangle-forwarded-authorizationand thread it to backends. ✓agent-gateway/src/has zerox-tangle-forwarded-*handling. ✓ (true negative)
Approving without further reservations. The new Implementation status table is exactly the kind of "what's actually shipped vs what the spec demands of conformant implementations" delineation that keeps a normative spec from rotting into vaporware.
Senior staff principal call to NOT build the original two follow-ups is the right one: cli-bridge depth is redundant with router-side enforcement, agent-gateway middleware has no consumer today. Both tracked on ops board for when a consumer surfaces.
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.
Summary
Doc-only correction to the protocol spec that shipped in #64. Investigation of the proposed follow-ups (`agent-gateway` middleware, `cli-bridge` propagation) surfaced two factual inaccuracies I'd written into the spec from assumption rather than measurement.
What I found while investigating the follow-ups
Doc bugs this fixes
Decision not to build the originally-named follow-ups (yet)
After reading the actual code:
Both are tracked on the ops board for when a real consumer materializes (a third-party agent-gateway deployment, or an agent-to-agent call that bypasses tangle-router).
What's NOT in this PR
This is a 17-line doc fix.
Test plan