github lukilabs/craft-agents-oss v0.8.11

8 hours ago

v0.8.11 — Messaging, Prompts, Chat & LLM Bug Fixes

Bug Fixes

  • WhatsApp selfChatMode now gates inbound symmetricallyclassifyInbound previously filtered only outbound (fromMe=true) traffic, so a contact DM or group message still routed to the bound session even with self-chat mode on — the agent could reply on the user's behalf in non-self-chats. Inbound from non-self-chats is now dropped when selfChatMode is on, with a new non_self_chat_inbound skip reason for log clarity. Back-compat preserved: with selfChatMode=false, inbound from contacts still emits as before.
  • call_llm recovers partial output instead of failing on SDK max turnsqueryLlm's SDK maxTurns was 1, so reasoning-model outputs that naturally span multiple SDK turns (even without tools) failed outright with "Reached maximum number of turns (1)". Bumped to 10, and the consumer is now defensive: captures partial assistant text + warning when the SDK yields an error-result or throws mid-stream instead of returning a bare failure. call_llm renders [Partial result — …] so callers see the signal. Added [queryLlm] debug logs (subtype, num_turns, stop_reason, errors) to close the observability gap. (Fixes lukilabs/craft-agents-oss#544)
  • Pi backend respects includeCoAuthoredBy: false — Pi sessions called getSystemPrompt() without the includeCoAuthoredBy argument, so it silently defaulted to true and rendered the Git Conventions block even when the user had disabled co-author attribution. Mirrors the earlier fix that only landed on the Claude path. getSystemPrompt also gained a defensive fallback: if a caller omits the arg, it resolves to the persisted getCoAuthorPreference() value instead of hard-coded true. (Fixes lukilabs/craft-agents-oss#576)
  • Follow-up quote sent to the agent in full — Large follow-up annotation quotes were silently truncated at ~280 characters before reaching the agent, because the shared normalizeExcerptForMessage helper's tooltip-tuned default cap applied on the agent-facing path. Agent path now uses normalizeFollowUpText (whitespace-collapse only, no length cap); the chip helper was renamed to truncateForChipTooltip and requires an explicit maxLength. A dead 140-char noteLabel pre-truncation was also removed. (Fixes lukilabs/craft-agents-oss#580)

Improvements

  • Chat follow-up helpers extracted and unit-testedformatFollowUpSection, truncateForChipTooltip, and normalizeFollowUpsMarkdown moved out of ChatDisplay.tsx into a sibling ChatDisplay.follow-ups.ts module with 13 targeted tests covering the >1000-char quote regression, canonical message shape, multi-follow-up numbering, the round-trip parser, and chip-tooltip behavior. Added a narrow @craft-agent/ui/annotations/follow-up-state subpath export so tests can import pure helpers without dragging in pdfjs + Vite-specific imports via the UI barrel.
  • queryLlm SDK-stream consumer extracted for testability — Moved into claude-llm-query.ts with 12 new tests covering thrown/yielded error paths, structured output, and the call_llm render block.
  • Pre-commit typecheck now auto-discovers TS workspacesscripts/typecheck-staged.sh previously hardcoded an 8-workspace allowlist, so staged TS changes in newer or renamed workspaces (messaging-*, apps/cli, apps/webui, etc.) silently skipped the hook. It now walks apps/<X>/ and packages/<X>/ and typechecks any workspace with a tsconfig.json, preferring bun run typecheck when defined. Surfaced and fixed four pre-existing TS errors that the old allowlist was hiding (apps/cli webhook typing, apps/marketing lib bump to ES2023 + card.codeHtml rename + indexed-access guards, apps/webui tsconfig alignment with Electron).
  • electron:dev now builds the WhatsApp worker on startupscripts/electron-dev.ts built the MCP servers and Pi agent server but not the WhatsApp worker, so fresh checkouts hit MODULE_NOT_FOUND on dist/worker.cjs the first time the user tried to connect WhatsApp — confusing because the Electron adapter reports it as a worker exit, not a missing-build error. Dev setup now shells out to the canonical scripts/build-wa-worker.ts (~70 ms) so the worker bundle stays in sync on every start.

Breaking Changes

  • None. No schema, IPC, or wire changes.

Don't miss a new craft-agents-oss release

NewReleases is sending notifications on new releases.