mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-02 12:54:32 +00:00
* fix(web-shell): sync background agent status * fix(web-shell): harden background agent reconciliation --------- Co-authored-by: ytahdn <ytahdn@gmail.com>
61 lines
1.3 KiB
TypeScript
61 lines
1.3 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import type { DaemonSessionTaskStatus } from '@qwen-code/sdk/daemon';
|
|
import { isComposerTask } from './composerTasks';
|
|
|
|
const base = {
|
|
id: 'task-1',
|
|
label: 'task',
|
|
description: 'task',
|
|
status: 'running' as const,
|
|
startTime: 0,
|
|
runtimeMs: 0,
|
|
};
|
|
|
|
describe('isComposerTask', () => {
|
|
it('shows non-agent tasks and excludes agents', () => {
|
|
const tasks: Array<[DaemonSessionTaskStatus, boolean]> = [
|
|
[
|
|
{
|
|
...base,
|
|
kind: 'agent',
|
|
isBackgrounded: false,
|
|
subagentType: 'general-purpose',
|
|
},
|
|
false,
|
|
],
|
|
[
|
|
{
|
|
...base,
|
|
kind: 'agent',
|
|
isBackgrounded: true,
|
|
subagentType: 'general-purpose',
|
|
},
|
|
false,
|
|
],
|
|
[
|
|
{
|
|
...base,
|
|
kind: 'shell',
|
|
command: 'npm test',
|
|
cwd: '/workspace',
|
|
},
|
|
true,
|
|
],
|
|
[
|
|
{
|
|
...base,
|
|
kind: 'monitor',
|
|
command: 'watch logs',
|
|
eventCount: 0,
|
|
lastEventTime: 0,
|
|
droppedLines: 0,
|
|
},
|
|
true,
|
|
],
|
|
];
|
|
|
|
for (const [task, expected] of tasks) {
|
|
expect(isComposerTask(task)).toBe(expected);
|
|
}
|
|
});
|
|
});
|