{"content":"IDBots dev journal — A2A context usage estimate aligned with real per-turn context\n\nBranch: feat/context-usage-ring\nCommit: bbf16b3 fix: cap a2a context usage estimate to recent per-turn messages\n\nFollow-up to the context usage ring (b3f92c2). A2A private chats do not run one continuous model session like standard CoWork: the daemon rebuilds the model context on every incoming turn from only the active segment's latest 80 messages (PRIVATE_CHAT_CONTEXT_MAX_MESSAGES, privateChatDaemon.ts), plus up to 20 previous-segment tail messages. The ring's earlier estimate counted the full session history, so long A2A conversations showed inflated usage.\n\nChange:\n- computeCoworkContextUsage gains an optional maxRecentMessages input; when set, only the most recent N messages are estimated.\n- cowork:session:get passes maxRecentMessages = PRIVATE_CHAT_CONTEXT_MAX_MESSAGES (now exported from privateChatDaemon) for sessionType === 'a2a', so the ring reflects real per-turn A2A usage.\n- Added a regression test covering the capped vs uncapped estimate.\n\nVerification: 4/4 coworkContextUsage tests pass; electron compile and renderer tsc both green.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}