Skip to content

fix: widen provider type to SupportedProvider#158

Merged
JackChen-me merged 1 commit into
mainfrom
fix/widen-agent-provider-type
Apr 23, 2026
Merged

fix: widen provider type to SupportedProvider#158
JackChen-me merged 1 commit into
mainfrom
fix/widen-agent-provider-type

Conversation

@JackChen-me

Copy link
Copy Markdown
Member

Surfaced in #153 review (Engram integration example used as AgentProvider to work around the narrow type).

Summary

AgentConfig.provider, CoordinatorConfig.provider, and OrchestratorConfig.defaultProvider were typed as a narrow 5-provider union ('anthropic' | 'copilot' | 'grok' | 'openai' | 'gemini') while createAdapter() in src/llm/adapter.ts already accepts the full 8-provider SupportedProvider union (adds azure-openai, deepseek, minimax). This forced users to cast when passing statically-valid providers.

Changes

  • src/types.ts: three config fields now reference SupportedProvider directly. One new import type from ./llm/adapter.js.

Backward compatibility

Fully additive. Any code that compiled against the narrow 5-provider union still compiles; only previously-rejected valid providers now type-check without a cast.

Test plan

  • npm run lint passes
  • npm test passes (667/667; provider dispatch coverage via existing tests/{deepseek,minimax,grok,gemini,openai,anthropic,copilot}-adapter.test.ts and tests/azure-openai-adapter.test.ts)

Follow-up

Once merged, #153 can drop the as AgentProvider cast after rebase.

…torConfig/OrchestratorConfig

`AgentConfig.provider`, `CoordinatorConfig.provider`, and
`OrchestratorConfig.defaultProvider` were typed as a narrow 5-provider
union (anthropic/copilot/grok/openai/gemini) while `createAdapter()`
already accepts the full 8-provider `SupportedProvider` union (adds
azure-openai/deepseek/minimax). This forced users to cast when passing
valid providers.

Widens the three fields to reference `SupportedProvider` directly. Fully
additive: no narrowing of previously valid usage.

Surfaced in #153 review (Engram integration example used
`as AgentProvider` to work around the narrow type).
@JackChen-me JackChen-me merged commit b850b4d into main Apr 23, 2026
4 checks passed
@JackChen-me JackChen-me deleted the fix/widen-agent-provider-type branch April 23, 2026 11:23
Agentscreator added a commit to Agentscreator/open-multi-agent that referenced this pull request Apr 23, 2026
…m, orchestrated demo)

- EngramMemoryStore: MemoryStore implementation backed by Engram REST API
- EngramToolkit: registers engram_commit, engram_query, engram_conflicts,
  engram_resolve tools with a ToolRegistry
- research-team.ts: standalone three-agent pipeline (researcher → fact-checker
  → writer) coordinating via Engram tools directly
- team-research.ts: orchestrated demo using runTeam() with EngramMemoryStore
  plugged in as sharedMemoryStore, exercising the TeamConfig.sharedMemoryStore
  feature from open-multi-agent#157

Both demos support all 8 providers via AGENT_PROVIDER/AGENT_MODEL env vars.
SupportedProvider imported from src/index.js (no local type alias or cast)
per review feedback on open-multi-agent#157 and the type widening in open-multi-agent#158.
@JackChen-me JackChen-me mentioned this pull request Apr 23, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant