mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
test(web): drive policy experiment through commands
This commit is contained in:
@@ -222,11 +222,11 @@ describe.skipIf(!ENABLED || !process.env.DEEPSEEK_API_KEY)('sandbox-policy wordi
|
||||
const prompt = samplePrompt(family, path, expected)
|
||||
try {
|
||||
const created = await rpc<{ sessionId: string }>(scaffold, 'session.create', {})
|
||||
await rpc<{ accepted: true }>(scaffold, 'session.prompt', {
|
||||
const command = await rpc<{ matched: boolean; commandId?: string }>(scaffold, 'command.execute', {
|
||||
sessionId: created.sessionId,
|
||||
mode: 'queue',
|
||||
content: [{ type: 'text', text: '/permission read-only' }],
|
||||
line: '/permission read-only',
|
||||
})
|
||||
if (!command.matched) throw new Error('read-only permission command was not matched')
|
||||
const configured = scaffold.ctx.agents.get(SessionId(created.sessionId))
|
||||
const configuredMode = configured?.session.events.findLast(event => event.type === 'sandbox/mode')
|
||||
if (configuredMode?.type !== 'sandbox/mode' || configuredMode.data.mode !== 'read-only') {
|
||||
|
||||
Reference in New Issue
Block a user