fix: guard flattenProviders against non-array p.models
Some OpenCode Serve /config/providers responses include providers without a 'models' field (or with a non-array value). The un-guarded for-of on p.models then throws 'p.models is not iterable' and crashes the inline prompt construction. Skip such providers instead. Also re-assert the button label as 'AI' (matches thedf2f3dflabel simplification, which the02cedacrevert had bundled away). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
02cedac138
commit
f7099be060
@@ -127,7 +127,7 @@ describe('OpenCodeCellActions', () => {
|
||||
const actions = new OpenCodeCellActions(cell);
|
||||
const btns = actions.node.querySelectorAll('button');
|
||||
expect(btns.length).toBe(1);
|
||||
expect(btns[0].textContent).toContain('🪄');
|
||||
expect(btns[0].textContent).toContain('AI');
|
||||
});
|
||||
|
||||
it('disables the button when notebook panel cannot be resolved', () => {
|
||||
|
||||
Reference in New Issue
Block a user