The beforeAll() approach created the API instance at the wrong time,
before the feature flag check was evaluated. Moving to describe-time
env var setting with inline API factory call ensures the API is created
after the flag is set.
This matches the pattern used successfully in the comparison tests
within the same file.
Co-authored-by: nate <nate@continue.dev>
Generated with [Continue](https://continue.dev)
Co-Authored-By: Continue <noreply@continue.dev>
The static import of 'ai' package in convertToolsToVercel.ts was still
loading the package early, interfering with @google/genai SDK's stream
handling and causing 'getReader is not a function' errors.
Changes:
- Made convertToolsToVercelFormat async with dynamic import of 'ai'
- Updated all call sites in OpenAI.ts and Anthropic.ts to await the function
- Updated convertToolsToVercel.test.ts to handle async function
This completes the dynamic import strategy across the entire import chain.
- Fix review issue #1: API timing in tests - Move API creation into beforeAll hook
- Fix review issue #2: Undefined parameters - Add default empty schema for tools
- Fix review issue #3: Timestamp format - Use seconds instead of milliseconds
- Fix review issue #4: Stop sequences - Handle both string and array types
- Fix Gemini compatibility: Convert to dynamic imports to prevent Vercel AI SDK from interfering with @google/genai
All Vercel AI SDK imports are now lazy-loaded only when feature flags are enabled, preventing the 'getReader is not a function' error in Gemini tests.
- Grouped function parameters into HandleToolCallsOptions interface
- Reduced parameter count from 6 to 1 (options object)
- Updated call site in streamChatResponse.ts to use new signature
Co-authored-by: nate <nate@continue.dev>
Add per-message cost tracking by capturing usage data from LLM API
responses and attaching it to assistant messages when saved to session.
- Update addAssistantMessage to accept usage parameter
- Modify handleToolCalls to pass usage to message creation
- Enhance processStreamingResponse to return usage with model and cost
- Calculate cost in cents and include model name in usage metadata
This enables the control plane cost analysis page to display accurate
per-message costs without client-side token estimation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The uploadArtifact tool was importing services at the module level,
creating a circular dependency:
services/index.ts -> ToolPermissionService -> allBuiltIns -> uploadArtifact -> services/index.ts
This caused ToolPermissionService to be undefined when instantiated,
resulting in "ToolPermissionService is not a constructor" errors
in all ToolPermissionService tests.
The fix moves the services import inside the run() function where
it's actually used, breaking the circular dependency while
maintaining the same functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replaces 'vi.mocked(new ToolPermissionService())' with a plain mock object
containing the necessary methods. This fixes the 'ToolPermissionService is
not a constructor' error that was causing all tests to fail.
Also adds getState method to artifactUpload mock for completeness.
Co-authored-by: nate <nate@continue.dev>
Fixes TypeScript error: 'Property betaUploadArtifactTool does not exist on type BaseCommandOptions'
ServiceInitOptions.options is typed as BaseCommandOptions, so betaUploadArtifactTool
needs to be in BaseCommandOptions rather than ExtendedCommandOptions.
Co-authored-by: nate <nate@continue.dev>
- Adds artifactUpload mock to services object with uploadArtifact and uploadArtifacts methods
- Adds ARTIFACT_UPLOAD to SERVICE_NAMES mock
This ensures tests that import services or SERVICE_NAMES don't fail due to missing mock definitions.
Co-authored-by: nate <nate@continue.dev>
- Makes ArtifactUploadService extend BaseService<ArtifactUploadServiceState>
- Implements doInitialize() instead of initialize()
- Uses currentState instead of private state field
- Removes custom setState method in favor of BaseService's setState
This aligns the service with the architecture pattern used by other services
in the CLI (UpdateService, ConfigService, etc.)
Co-authored-by: nate <nate@continue.dev>
The previous CI run failed on macOS Node.js 18/22 tests which are known
to be flaky and unrelated to the blueprint JSON configuration change.
Co-authored-by: nate <nate@continue.dev>
Generated with [Continue](https://continue.dev)
Co-Authored-By: Continue <noreply@continue.dev>
Pre-install gh CLI in the Runloop blueprint to enable PR creation
and other GitHub operations directly from the environment.
Co-authored-by: nate <nate@continue.dev>
Generated with [Continue](https://continue.dev)
Co-Authored-By: Continue <noreply@continue.dev>
Replace console.log with logger.info for initial prompt messages to
maintain consistency with codebase logging practices.
Co-authored-by: nate <nate@continue.dev>