Repository navigation
feat(provider): V4 type crate aimux-provider (phase 1 unit 1.6) - #16
Open
cunninghamcard-bit wants to merge 13 commits into
Open
cunninghamcard-bit wants to merge 13 commits into
cunninghamcard-bit wants to merge 13 commits into
Conversation
…pes (1.6 design draft, not wired)
…std Error, no wire; D21)
Only pull_request runs cancel in-progress runs in the same group; master push runs are never cancelled. Note: with push limited to master (previous commit), direct pushes to exp/restart no longer run CI separately; exp/** branches are covered only via pull_request.
cunninghamcard-bit
added a commit
that referenced
this pull request
Oct 11, 2026
…data; per-provider core-conversion tests
- Provider { dynamic, mark: ProviderExecutedMark::{Unmarked, Marked} }
replaces the bool; documented as transitional until E.3b moves the
provider side to #16's V4 tool-result type.
- Client { dynamic, provider_executed: Option<bool> }: plain data, no
hidden 'input had false' marker. Test: absent / false client samples
round-trip byte for byte.
- provider_executed_core_conversion_test: anthropic, google, vertex,
openai responses, xai, huggingface each yield providerExecuted:true
through generate_text and stream_text (cassettes / upstream-port bodies).
JSON and TS unchanged.
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.
Phase 1 unit 1.6: design draft of the V4 layers in RFC-0042 §3.1 / arcships#200:58. This adds a new
aimux-providercrate holding only the AI SDK@ai-sdk/provider@4.0.21language-model/v4andshared/v4types. It is a workspace member; nothing depends on it and nothing is wired to it.serdeandserde_json; no aimux crate (docs: full-chain AI SDK alignment design and impact map arcships/aimux#200 §2.1 constraint 1).cargo tree -p aimux-providershows only those two, andcargo tree -i aimux-providershows nothing depends on it. A test enforces this from the manifest.type/role/sourceTypetags, absent optionals omitted, bytes as base64 text.tool-call.inputis parsed JSON (JsonValue);tool-call.inputis the provider's text (String);delta;LanguageModelV4interface (doGenerate,doStream,supportedUrls) andabortSignal, which are behaviour rather than data.cargo test -p aimux-provider— exact JSON round trips for every variant, rejection of unknown tags, and the no-aimux-dependency check.Note: this branch is cut from
exp/unit2-ciso that CI triggers, so the diff againstexp/restartalso includes unit 2'sci.ymlchange.Errors (D21)
aimux_provider::ProviderErroris one enum with one variant per class in@ai-sdk/provider@4.0.21src/errors/. It implementsstd::error::ErrorandDisplay:message, and the constructors fill in upstream's default messages;causeis reachable throughsource();name()returns theAI_*name;is_retryable()is true only forApiCall, whose default mirrors upstream (status 408/409/429/≥500, and an explicit value wins).There is no serde and no wire format; mapping to aimux error codes and golden fixtures is deferred to 3.3.
AiSdkAISDKError(ai-sdk-error.ts)ApiCallAPICallError(api-call-error.ts)EmptyResponseBodyEmptyResponseBodyError(empty-response-body-error.ts)EvaluationUnsupportedQuestionTypeEvaluationUnsupportedQuestionTypeError(evaluation-unsupported-question-type-error.ts)InvalidArgumentInvalidArgumentError(invalid-argument-error.ts)InvalidPromptInvalidPromptError(invalid-prompt-error.ts)InvalidResponseDataInvalidResponseDataError(invalid-response-data-error.ts)JsonParseJSONParseError(json-parse-error.ts)LoadApiKeyLoadAPIKeyError(load-api-key-error.ts)LoadSettingLoadSettingError(load-setting-error.ts)NoContentGeneratedNoContentGeneratedError(no-content-generated-error.ts)NoSuchModelNoSuchModelError(no-such-model-error.ts)NoSuchProviderReferenceNoSuchProviderReferenceError(no-such-provider-reference-error.ts)TooManyEmbeddingValuesForCallTooManyEmbeddingValuesForCallError(too-many-embedding-values-for-call-error.ts)TypeValidationTypeValidationError(type-validation-error.ts, incl.TypeValidationContext)UnsupportedFunctionalityUnsupportedFunctionalityError(unsupported-functionality-error.ts)get-error-message.tsis a helper, not a class; it is used for the cause text inside the messages.tests/errors_test.rs(7 tests) covers construction, Display text,is_retryableand the source chain.