Skip to content

feat(router): let profileChatClient callers add request headers #1330

Description

@drewstone

Problem

A caller cannot add a request header to Router completions that profileChatClient (and profileOptimizerModelCall) send.

bindProfileChat builds the executor with createExecutor(args.executor), and runBoundProfileChat calls streamAgentTurn without ExecutorContext.propagatedHeaders.
RouterSeam has no header field.
The only other route is RouterSeam.complete, but a caller-supplied transport cannot throw Runtime's SDKError, so withRetry loses the HTTP status and stops retrying 429 and 5xx responses.

Need

Braid must send x-tangle-client: braid/<version> on every request it sends to the Tangle router, so tangle-admin attributes the usage.
Braid's direct Router turns already do this by wrapping the executor factory and setting ExecutorContext.propagatedHeaders.
Braid's semantic eval judge uses profileChatClient and cannot.

Proposed change

Accept optional request headers on the Router executor config (for example RouterSeam.headers), or accept propagatedHeaders on profileChatClient args and forward them into the executor context.
Runtime's own content-type, authorization, idempotency-key, and x-correlation-id should keep precedence, as they do for propagatedHeaders today.

Braid tracking: tangle-network/braid feat/router-client-attribution.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions