qwen-code/packages/core
wenshao dbad3f9449 fix(cli): reconcile registry-missing snapshots as just-finished + address review nits
Hot-fix: the previous round's "drop the row when registry.get()
returns undefined" was too aggressive. `unregisterForeground` calls
`emitStatusChange(entry)` BEFORE it deletes the entry, so the
snapshot useBackgroundTaskView captures still says "running" while
the very next render's registry.get sees nothing. Dropping the row
outright made foreground subagents disappear from the panel the
instant they finished — users saw "SubAgents 不显示了" on tasks that
ran-and-immediately-completed.

Reconciliation now has three branches:
  1. live found → use live (newest recentActivities).
  2. snap says still-live but registry forgot → synthesize a
     terminal version with endTime pinned to the FIRST observation
     so the 8s visibility window gives the user a "the agent
     finished" beat then evicts cleanly. The first-seen-missing
     timestamp is held in a useRef map (without it, each tick
     resets endTime to `now` and the row never expires).
  3. snap is already terminal but registry forgot → drop (no
     useful state to keep showing).

Also addresses three smaller review notes (deepseek-v4-pro via
/review):

- DEFAULT_SUBAGENT_TYPE is now imported from
  @qwen-code/qwen-code-core (a new DEFAULT_BUILTIN_SUBAGENT_TYPE
  export referenced by both BuiltinAgentRegistry's seed entry and
  the panel's default-type elision). A backend rename now propagates
  instead of silently re-introducing the redundant
  `general-purpose:` prefix on every row.
- The useMemo body now reads `now` (as `reconcileAt`) so the
  dependency is semantically honest — a future "remove dead dep"
  cleanup can no longer silently freeze the panel on the first
  tool-call after a snapshot refresh.

Coverage delta: +5 cases on LiveAgentPanel.test.tsx — token rendering
on completed entries, status-icon routing for paused / failed /
cancelled (parametrized), case-insensitive prefix stripping in
descriptionWithoutPrefix, plus the rewritten ghost-row case
(synthesized terminal lingers 8s then evicts) and a sibling case
asserting already-terminal snapshots with empty registry still drop.

17 LiveAgentPanel tests pass.
2026-05-07 19:45:07 +08:00
..
scripts
src fix(cli): reconcile registry-missing snapshots as just-finished + address review nits 2026-05-07 19:45:07 +08:00
vendor feat test tool permissions 2026-03-10 16:30:22 +08:00
index.ts fix: Remove remaining ClearcutLogger export from packages/core/index.ts 2026-02-01 14:52:14 +08:00
package.json chore(release): v0.15.6 (#3766) 2026-04-30 15:59:35 +08:00
test-setup.ts feat(memory): managed auto-memory and auto-dream system (#3087) 2026-04-16 20:05:45 +08:00
tsconfig.json fix: upgrade @lydell/node-pty to 1.2.0-beta.10 to fix PTY FD leak 2026-04-01 07:55:56 +08:00
vitest.config.ts