Skip to content

fix(skills): align llm-provider stream() signature across platforms#178

Open
xiaolai wants to merge 1 commit intocaliber-ai-org:masterfrom
xiaolai:fix/nlpm-llm-provider-stream-signature
Open

fix(skills): align llm-provider stream() signature across platforms#178
xiaolai wants to merge 1 commit intocaliber-ai-org:masterfrom
xiaolai:fix/nlpm-llm-provider-stream-signature

Conversation

@xiaolai
Copy link
Copy Markdown

@xiaolai xiaolai commented Apr 20, 2026

Automated audit: This PR was generated by NLPM, a natural language programming linter, running via claude-code-action. Please evaluate the diff on its merits.

Bug

The .agents/ and .cursor/ copies of skills/llm-provider/SKILL.md document incompatible LLMProvider.stream() signatures that contradict the actual interface in src/llm/types.ts:

Platform Documented stream() signature
.claude/ stream(options: LLMStreamOptions, callbacks: LLMStreamCallbacks): Promise<void>
.agents/ async *stream(request: LLMRequest): AsyncGenerator<string>
.cursor/ async *stream(messages: ChatMessage[], params: ChatParams): AsyncIterable<StreamChunk>

The actual interface (from src/llm/types.ts):

export interface LLMProvider {
  call(options: LLMCallOptions): Promise<string>;
  stream(options: LLMStreamOptions, callbacks: LLMStreamCallbacks): Promise<void>;
  listModels?(): Promise<string[]>;
}

Why it matters

An agent following the .agents/ or .cursor/ skill will generate a provider class with a generator-based stream() method that doesn't match the LLMProvider interface. This produces a TypeScript compile error (does not implement LLMProvider) before any code runs, breaking provider development for anyone using those platform skills.

Fix

Updated .agents/ and .cursor/ to document the correct callback-based signature, matching .claude/ and the actual src/llm/types.ts definition. Import types and constructor pattern also corrected in the .cursor/ version which had diverged more significantly (was using ChatMessage[], ChatParams, ChatError, StreamChunk — none of which exist in this codebase).

The .agents/ and .cursor/ llm-provider skills described incompatible
LLMProvider.stream() signatures that contradict src/llm/types.ts:
- .agents/ used AsyncGenerator<string> (generator pattern)
- .cursor/ used AsyncIterable<StreamChunk> with ChatMessage[]/ChatParams

The actual interface is callback-based:
  stream(options: LLMStreamOptions, callbacks: LLMStreamCallbacks): Promise<void>

Updated both platform copies to match the authoritative .claude/ version
and the actual src/llm/types.ts definition.

Co-Authored-By: Claude Code <noreply@anthropic.com>
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