fix: accept external Workdirs in Browser subscriptions

This commit is contained in:
2026-09-30 01:14:24 +09:00
parent 5f19dcc93f
commit 677c7cfed9
4 changed files with 42 additions and 6 deletions
File diff suppressed because one or more lines are too long
@@ -42,6 +42,37 @@ Deno.test('generated subscription validator accepts a current exact frame', () =
assert(result.value.frame === 'response', 'expected response frame');
});
Deno.test('generated subscription validator accepts an external Workdir Worker', () => {
const result = decode(subscribedFrame({
snapshot: {
topic: 'workers',
data: {
workers: [
{
worker_id: 'worker-1',
runtime_id: 'runtime-1',
resource_key: 'worker-resource-1',
availability: 'observed',
subject_revision: 1,
state: 'idle',
has_running_internal_workers: false,
workspace_id: 'workspace-1',
display_name: 'Companion',
profile: 'companion',
workdir_attachments: [
{
alias: 'workspace',
working_directory_id: 'external-workdir-1',
},
],
},
],
},
},
}));
assert(result.ok, `external Workdir Worker was rejected: ${JSON.stringify(result)}`);
});
Deno.test('Rust-serialized compatibility fixtures satisfy the generated Browser contract', () => {
for (const fixture of RUST_SERIALIZED_SUBSCRIPTION_FRAME_FIXTURES) {
const result = decode(fixture);