Skip to content

Commit cd02a3f

Browse files
committed
fix: address CI build and format checks
1 parent c64916c commit cd02a3f

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/sessions/agents/utils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ export function extractClaudeSessionName(content: string): string | null {
3030
return null;
3131
}
3232

33-
export function extractContent(
34-
content: string | Array<{ type: string; text?: string }> | undefined
35-
): string | null {
33+
export function extractContent(content: unknown): string | null {
3634
if (!content) return null;
3735
if (typeof content === 'string') return content;
3836
if (Array.isArray(content)) {
3937
const textParts = content
38+
.filter(
39+
(part): part is { type: string; text?: string } =>
40+
typeof part === 'object' && part !== null && 'type' in part
41+
)
4042
.filter((part) => part.type === 'text' && part.text)
4143
.map((part) => part.text);
4244
return textParts.join('\n') || null;

test/models/discovery.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,17 @@ opencode/claude-opus-4-5`;
7979

8080
describe('shouldUseCachedOpencodeModels', () => {
8181
test('uses cached models for workspace-specific requests', () => {
82-
const cached = [{ id: 'github-copilot/claude-opus-4.5', name: 'Claude Opus 4.5', provider: 'github-copilot' }];
82+
const cached = [
83+
{ id: 'github-copilot/claude-opus-4.5', name: 'Claude Opus 4.5', provider: 'github-copilot' },
84+
];
8385

8486
expect(shouldUseCachedOpencodeModels(cached, true, 'workspace-name')).toBe(true);
8587
});
8688

8789
test('skips cache when preferring workspace models without opencode provider', () => {
88-
const cached = [{ id: 'github-copilot/claude-opus-4.5', name: 'Claude Opus 4.5', provider: 'github-copilot' }];
90+
const cached = [
91+
{ id: 'github-copilot/claude-opus-4.5', name: 'Claude Opus 4.5', provider: 'github-copilot' },
92+
];
8993

9094
expect(shouldUseCachedOpencodeModels(cached, true)).toBe(false);
9195
});
@@ -100,7 +104,9 @@ describe('shouldUseCachedOpencodeModels', () => {
100104
});
101105

102106
test('uses cache when workspace models not preferred', () => {
103-
const cached = [{ id: 'github-copilot/claude-opus-4.5', name: 'Claude Opus 4.5', provider: 'github-copilot' }];
107+
const cached = [
108+
{ id: 'github-copilot/claude-opus-4.5', name: 'Claude Opus 4.5', provider: 'github-copilot' },
109+
];
104110

105111
expect(shouldUseCachedOpencodeModels(cached, false)).toBe(true);
106112
});

0 commit comments

Comments
 (0)