fix(prompt): api.blockrun.ai is not an alias of the Base gateway - #168
Merged
Conversation
The gateway section handed the model this: - Base chain: https://blockrun.ai/api (alias: https://api.blockrun.ai) Those are different services. api.blockrun.ai authenticates a bearer key and 401s without one; blockrun.ai and sol.blockrun.ai answer a 402 challenge and ignore a key entirely. Told they are aliases, the model can send a wallet-signed request to a host that cannot settle it, or a key to a host that cannot read it, and the failure looks like a gateway bug rather than a routing mistake. The section was also unconditional, so it never said which host THIS session is on. It now names one: api.blockrun.ai for a key, sol.blockrun.ai/api for Solana, blockrun.ai/api for Base — plus which hosts are not yours and why, and an instruction not to switch billing modes to work around an API error. Found while auditing that: assembleInstructions' cache key carried the pay mode but not the chain. Both the gateway host and the wallet guidance name the active chain, so a base -> solana switch inside one process was served the previous chain's instructions. The key now carries the full billing identity. Request routing itself was already correct — no caller bypasses gatewayBase() and there are no hardcoded gateway hosts. This was the agent's own map being wrong, not the plumbing. Mutation-tested: restoring the alias line fails 3 tests, dropping the chain from the cache key fails 1. 756 local tests pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rm7cRGtC7wCofhYuHRo21h
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.
The gateway section handed the model this:
Those are different services:
api.blockrun.aiblockrun.ai/apisol.blockrun.ai/apiTold they are aliases, the model can send a wallet-signed request to a host that cannot settle it, or a key to a host that cannot read it — and the failure reads like a gateway bug rather than a routing mistake.
The section was also unconditional, so it never said which host this session is on. Now it names one:
…plus which hosts are not yours and why, and an instruction never to switch billing modes to work around an API error.
Found while auditing it:
assembleInstructions' cache key carried the pay mode but not the chain. Both the gateway host and the wallet guidance name the active chain, so abase→solanaswitch inside one process was served the previous chain's instructions.Request routing itself was already correct — no caller bypasses
gatewayBase(), no hardcoded gateway hosts, and all five mode/chain combinations resolve to the right base. This was the agent's own map being wrong, not the plumbing.Mutation-tested: restoring the alias line fails 3 tests; dropping the chain from the cache key fails 1. 756 local tests pass.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Rm7cRGtC7wCofhYuHRo21h