internal/tools/minimax (the generate_video tool) is a hand-rolled HTTP client (Config/Client/GenerateAndWait against MiniMax's video-generation API) that duplicates functionality ai-sdk already provides generically: video.Provider (Name/GenerateVideo(ctx,req)(resp,error)), core.GenerateVideo, and registry.RegisterVideo/.Video(name) -- the same registration shape chat models and the new image capability use. MiniMax's async submit-then-poll GenerateAndWait fits behind video.Provider's single blocking call fine; nothing about the interface forces synchronous-only backends.
Currently: not extensible (a second video backend would have to duplicate all the HTTP/poll scaffolding instead of just implementing video.Provider) and not reusable (can't be registered/discovered alongside a future video provider the way chat models and image providers can).
Fix: wrap minimax.Client behind an adapter implementing ai-sdk's video.Provider, register it via registry.RegisterVideo instead of the tool holding a bespoke *minimax.Client directly. Keep minimax.Client itself as the low-level HTTP/poll implementation -- only the tool-facing seam changes.
Design
Mirrors the note left on archie-core-1786748942169-3-ae7cfaea for the hosted image provider: adapt ai-sdk's existing provider-agnostic facility instead of a bespoke client. Adapter should preserve GenerateAndWait's polling behavior internally -- video.Provider's synchronous call shape does not require changing MiniMax's async job semantics, only where the polling loop is invoked from.
Acceptance criteria
minimax.Client (or a thin adapter) implements ai-sdk/video.Provider; the generate_video tool obtains it through the ai-sdk provider registry, not a bespoke config-to-client wiring; existing tests (minimax_test.go, tool_test.go) still pass or are updated for the new seam; task check passes.
Close reason
Done, by deletion. ai-sdk v0.1.43 already ships provider/minimax implementing video.Provider with the same v2/video_generation endpoints, MiniMax-H3 default, 768P/6s defaults and submit-then-poll loop, plus typed ProviderError classification. Deleted internal/tools/minimax/minimax.go (292 lines) and made the tool take a video.Provider; archiegateway's registerMinimaxTool builds the ai-sdk provider, matching the transcription and embedding capabilities. Did not add the single-entry ai-sdk registry: no capability in the tree uses registry.Register*, the tool still needs the same provider construction at the composition root, so the registry would be a map with one entry and no consumer. Commit 04692fc2.
Imported from beads archie-core-1y6y · GitHub #681 · type task · priority P3 · created 2026-09-02 · closed 2026-10-08
internal/tools/minimax (the generate_video tool) is a hand-rolled HTTP client (Config/Client/GenerateAndWait against MiniMax's video-generation API) that duplicates functionality ai-sdk already provides generically: video.Provider (Name/GenerateVideo(ctx,req)(resp,error)), core.GenerateVideo, and registry.RegisterVideo/.Video(name) -- the same registration shape chat models and the new image capability use. MiniMax's async submit-then-poll GenerateAndWait fits behind video.Provider's single blocking call fine; nothing about the interface forces synchronous-only backends.
Currently: not extensible (a second video backend would have to duplicate all the HTTP/poll scaffolding instead of just implementing video.Provider) and not reusable (can't be registered/discovered alongside a future video provider the way chat models and image providers can).
Fix: wrap minimax.Client behind an adapter implementing ai-sdk's video.Provider, register it via registry.RegisterVideo instead of the tool holding a bespoke *minimax.Client directly. Keep minimax.Client itself as the low-level HTTP/poll implementation -- only the tool-facing seam changes.
### Design
Mirrors the note left on archie-core-1786748942169-3-ae7cfaea for the hosted image provider: adapt ai-sdk's existing provider-agnostic facility instead of a bespoke client. Adapter should preserve GenerateAndWait's polling behavior internally -- video.Provider's synchronous call shape does not require changing MiniMax's async job semantics, only where the polling loop is invoked from.
### Acceptance criteria
minimax.Client (or a thin adapter) implements ai-sdk/video.Provider; the generate_video tool obtains it through the ai-sdk provider registry, not a bespoke config-to-client wiring; existing tests (minimax_test.go, tool_test.go) still pass or are updated for the new seam; task check passes.
### Close reason
Done, by deletion. ai-sdk v0.1.43 already ships provider/minimax implementing video.Provider with the same v2/video_generation endpoints, MiniMax-H3 default, 768P/6s defaults and submit-then-poll loop, plus typed ProviderError classification. Deleted internal/tools/minimax/minimax.go (292 lines) and made the tool take a video.Provider; archiegateway's registerMinimaxTool builds the ai-sdk provider, matching the transcription and embedding capabilities. Did not add the single-entry ai-sdk registry: no capability in the tree uses registry.Register*, the tool still needs the same provider construction at the composition root, so the registry would be a map with one entry and no consumer. Commit 04692fc2.
---
_Imported from beads `archie-core-1y6y` · GitHub #681 · type task · priority P3 · created 2026-09-02 · closed 2026-10-08_
sam
added the lowtask labels 2026-10-27 13:38:40 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
internal/tools/minimax (the generate_video tool) is a hand-rolled HTTP client (Config/Client/GenerateAndWait against MiniMax's video-generation API) that duplicates functionality ai-sdk already provides generically: video.Provider (Name/GenerateVideo(ctx,req)(resp,error)), core.GenerateVideo, and registry.RegisterVideo/.Video(name) -- the same registration shape chat models and the new image capability use. MiniMax's async submit-then-poll GenerateAndWait fits behind video.Provider's single blocking call fine; nothing about the interface forces synchronous-only backends.
Currently: not extensible (a second video backend would have to duplicate all the HTTP/poll scaffolding instead of just implementing video.Provider) and not reusable (can't be registered/discovered alongside a future video provider the way chat models and image providers can).
Fix: wrap minimax.Client behind an adapter implementing ai-sdk's video.Provider, register it via registry.RegisterVideo instead of the tool holding a bespoke *minimax.Client directly. Keep minimax.Client itself as the low-level HTTP/poll implementation -- only the tool-facing seam changes.
Design
Mirrors the note left on archie-core-1786748942169-3-ae7cfaea for the hosted image provider: adapt ai-sdk's existing provider-agnostic facility instead of a bespoke client. Adapter should preserve GenerateAndWait's polling behavior internally -- video.Provider's synchronous call shape does not require changing MiniMax's async job semantics, only where the polling loop is invoked from.
Acceptance criteria
minimax.Client (or a thin adapter) implements ai-sdk/video.Provider; the generate_video tool obtains it through the ai-sdk provider registry, not a bespoke config-to-client wiring; existing tests (minimax_test.go, tool_test.go) still pass or are updated for the new seam; task check passes.
Close reason
Done, by deletion. ai-sdk v0.1.43 already ships provider/minimax implementing video.Provider with the same v2/video_generation endpoints, MiniMax-H3 default, 768P/6s defaults and submit-then-poll loop, plus typed ProviderError classification. Deleted internal/tools/minimax/minimax.go (292 lines) and made the tool take a video.Provider; archiegateway's registerMinimaxTool builds the ai-sdk provider, matching the transcription and embedding capabilities. Did not add the single-entry ai-sdk registry: no capability in the tree uses registry.Register*, the tool still needs the same provider construction at the composition root, so the registry would be a map with one entry and no consumer. Commit
04692fc2.Imported from beads
archie-core-1y6y· GitHub #681 · type task · priority P3 · created 2026-09-02 · closed 2026-10-08