fix(agent): escape task notification summaries and surface subagent consumption - #51
Merged
Merged
Conversation
…onsumption Three unrelated-but-small fixes around subagent reporting. The agent description is model-supplied tool input interpolated straight into the <summary> element of the task notification. A bracket in it closes the tag early, so the parser reads a truncated summary followed by whatever the description claimed next, a forged <status> included. Strip brackets, and add a test that fails when the escaping is removed. The background task list showed only a description and a status for local_agent rows, while the token and tool counts were already on the task. Show them, taking the finished result when the agent is done and live progress otherwise. The React Compiler cache in that file is a checked-in artifact and the build does not regenerate it, so the six new slots are appended at 92..97 and the cache grows to 98 rather than being inserted mid-range, which would have shifted the slots the sibling switch branches still read. A model override passed to a coordinator worker was dropped silently. Log it, so a run on an unexpected model is traceable.
savass33
force-pushed
the
fix/agent-notification-and-progress-ui
branch
from
September 10, 2026 18:53
4847554 to
0d01353
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Substitui o #49. Parte a partir do
mainatual (pós-v0.15.21) e traz só o que continua válido de lá.O que mudou
Envelope da notificação de task —
descriptioné input de tool vindo do modelo e é interpolado direto no elemento<summary>. Um<fecha a tag cedo: o parser lê um summary truncado seguido do que a description afirmar depois, inclusive um<status>forjado. Passa a remover os brackets, com teste que falha se a sanitização sair.Consumo do subagente na lista de background tasks — as linhas
local_agentmostravam só descrição e status, com token/tool count já disponíveis no task. Passa a exibir· N tokens · N tools, usando oresultquando o agente terminou e oprogressenquanto roda.Model override em coordinator mode — era descartado em silêncio. Agora loga, então uma execução em modelo inesperado fica rastreável.
Sobre os slots do React Compiler
BackgroundTask.tsxé artefato compilado versionado (_c(92), import dereact-compiler-runtime), e o build não regera —scripts/build.tssó faz shim dereact/compiler-runtimee não hábabel-plugin-react-compilerno projeto.Por isso os 6 slots novos foram anexados em 92..97, com o cache subindo para
_c(98), em vez de inseridos no meio da faixa docase "local_agent". Inserir no meio deslocaria os slots que os outroscasedo switch ainda leem: ocase "in_process_teammate"usa 32..39. Como o array$persiste entre renders da mesma instância, duas faixas sobrepostas fazem as guardas nunca baterem e a memoização morrer. Anexando no fim, nada mais se move.O que ficou de fora do #49, e por quê
Todo o
syncProgressUsageFromMessagese otokenProgress.test.ts.O
mainjá corrigiu esse bug em7d5b362(v0.15.21), por outra arquitetura: oProgressTrackerguardamessages: Map<uuid, Message>egetTrackerUsage()calcula na leitura viaagentUsageFromMessages(). É a mesma sacada — as referências acumuladas são o que omessage_deltamuta in-place — implementada como leitura preguiçosa em vez de recomputo eager, e com dedupe por uuid que a versão do #49 não tinha.Mergear o #49 era pior que não mergear: o git faz auto-merge do
LocalAgentTask.tsxsem conflito e o resultado escreve emtracker.latestInputTokens/cumulativeOutputTokens, campos que não existem mais.E o "conserto óbvio" (readicionar os campos pra calar o TS) seria o pior caso: os writes viram no-op silencioso, porque
getProgressUpdatelêgetTokenCountFromTracker, que nomainresolve porusageUpdates/messages.Validação
tsc --noEmit: zero erros novos vs. o baseline domain(o baseline já tem 2350 linhas de erro pré-existentes, comparei os conjuntos).bun testcompleto: 62 falhas idênticas às domain, 0 novas, 0 corrigidas — conjuntos comparados linha a linha.bun test src/tasks/ src/tools/AgentTool/ src/components/tasks/: 16 pass, 0 fail._c(98)com max slot 97 e nenhuma lacuna.