Skip to content

feat: trace chatd provider attempts with model and effort - #28971

Closed
jscottmiller wants to merge 1 commit into
scott/chatd-stages/3-stream-stagesfrom
scott/chatd-stages/4-provider-attempts
Closed

jscottmiller wants to merge 1 commit into
scott/chatd-stages/3-stream-stagesfrom
scott/chatd-stages/4-provider-attempts

Conversation

@jscottmiller

@jscottmiller jscottmiller commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #29770. Closed in favor of the reduced stack #29773.

Wraps the provider HTTP transport in stageSpanRoundTripper, which emits one provider_attempt stage per round trip, so retries each get a span. The span closes on response headers; a status >= 400 marks it errored without changing what the client sees.

resolveModelCall resolves the provider type, model, and effective reasoning effort once and threads them to the transport as modelBuildOptions.StageModel, so span attributes and the provider_type / model labels match the call. provider_type is read from ai_providers.type directly rather than the normalized provider hint, so types outside the fantasy set (copilot) keep their configured name. Effort stays a span attribute only.

Server gains the stages tracer and a TracerProvider option (nil disables spans, not metrics), wired from coderd.

🤖 This PR was generated by Coder Agents on behalf of @jscottmiller.

@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from ffc1233 to cf79f38 Compare September 9, 2026 23:19
@jscottmiller jscottmiller added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Sep 11, 2026
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from cf79f38 to 8b252aa Compare September 11, 2026 02:25
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from 8b252aa to 2653138 Compare September 11, 2026 19:17
@jscottmiller jscottmiller removed the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Sep 14, 2026
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from 2653138 to c7c1ea8 Compare September 14, 2026 20:16
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from c7c1ea8 to 70e3aa1 Compare September 14, 2026 22:06
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from 70e3aa1 to 5e03cdf Compare September 15, 2026 21:39
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from 5e03cdf to 0aa105f Compare September 16, 2026 03:12
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from 0aa105f to bcca128 Compare September 17, 2026 16:55
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from bcca128 to cdfb66c Compare September 17, 2026 20:31
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from cdfb66c to 34c4cf8 Compare September 17, 2026 21:26
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch 2 times, most recently from 4a1c32a to 97f7512 Compare September 21, 2026 22:52
@linear-code

linear-code Bot commented Sep 22, 2026

Copy link
Copy Markdown

CODAGT-1102

@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from 97f7512 to b5a1e5a Compare September 23, 2026 01:37
Wrap the AI Bridge transport in stageSpanRoundTripper so every HTTP
round trip to a provider is a provider_attempt stage with its own span,
labeled with the HTTP method, host, and status code. resolveModelCall
resolves the effective reasoning effort once and carries it with the
configured provider type and the model name as a StageModel through
modelBuildOptions, so the transport labels attempts the way the call
options were sent. The Server gains the StageTracer and a
TracerProvider config field that coderd wires from its own tracer
provider.
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from b5a1e5a to 9634c4a Compare September 23, 2026 02:14
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant