fix(cua): complete basic approval extraction
This commit is contained in:
1 parent
1954e948cb
commit
8ad4e308a7
3 files changed
+4
-7
No files matched your search
@@ -310,7 +310,7 @@ it('fills application names, system permissions, and icons as their observations
|
||||
it.each(['applications', 'icons'] as const)('contains a failed %s query in the application section', (key) => {
|
||||
const f = fixture()
|
||||
f.publish({ ...observe(value), [key]: { value: null, busy: false, error: 'offline' } })
|
||||
const view = render(<PermissionPanel {...f.props} />)
|
||||
render(<PermissionPanel {...f.props} />)
|
||||
const requirements = screen.getByRole('region', { name: en.title })
|
||||
const access = screen.getByRole('region', { name: en.applicationsTitle })
|
||||
expect(within(requirements).getByText(en.granted)).toBeTruthy()
|
||||
@@ -318,8 +318,6 @@ it.each(['applications', 'icons'] as const)('contains a failed %s query in the a
|
||||
expect(within(access).getByRole('alert').textContent).toContain('offline')
|
||||
fireEvent.click(within(access).getByRole('button', { name: en.retry }))
|
||||
expect(f.props.refresh).toHaveBeenCalledTimes(2)
|
||||
view.rerender(<PermissionPanel {...f.props} busy />)
|
||||
expect(screen.queryByRole('alert')).toBeNull()
|
||||
})
|
||||
|
||||
it('finishes activation guidance without waiting for application icons', () => {
|
||||
|
||||
@@ -4,6 +4,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join, resolve } from 'node:path'
|
||||
import { setImmediate } from 'node:timers/promises'
|
||||
import { Context, FiberState } from '@deepseek-ai/cordis'
|
||||
import Loader from '@deepseek-ai/cordis-plugin-loader'
|
||||
import { mountAgentLoopTestDependencies, mountAgentLoopTestHarness } from '@deepseek-ai/dsh-agent-loop-testkit'
|
||||
import ComputerUseRegistry from '@deepseek-ai/dsh-computer-use'
|
||||
import LocalAttachmentStore from '@deepseek-ai/dsh-attachment-local'
|
||||
|
||||
@@ -265,10 +265,8 @@ export function installCua(ctx: Context, config: CuaConfig, backend: CuaBackend)
|
||||
: await requestNative()
|
||||
if (method === 'getApp') {
|
||||
const prepared = AppResult.extend({ pid: AppResult.shape.pid.nullable() }).parse(result)
|
||||
const { authorization, applicationIcon } = z.object({ authorization: ApplicationAuthorizationResult,
|
||||
applicationIcon: ApplicationIcon.optional(),
|
||||
}).parse(result)
|
||||
await access.select(agent, client, prepared.appHandle, authorization, signal, applicationIcon)
|
||||
const { authorization } = z.object({ authorization: ApplicationAuthorizationResult }).parse(result)
|
||||
await access.select(agent, client, prepared.appHandle, authorization, signal)
|
||||
signal.throwIfAborted()
|
||||
const selected = prepared.pid === null
|
||||
? AppResult.parse(await access.run(client, prepared.appHandle, signal,
|
||||
|
||||
Reference in new issue
Block a user