Commit Graph

6 Commits

Author SHA1 Message Date
kiranjd
c90cda7946 fix(sessions): truncate at incomplete tool calls instead of inserting synthetic results
When session history contains an assistant message with tool calls but
missing results (e.g., due to branching, interruption, or crash), the
API rejects the request. Previously, we tried to repair this by
inserting synthetic error results, but this approach was fragile and
could lead to confusing conversation states.

New approach: truncate history before the first incomplete tool call
sequence. This is simpler and always produces valid history:

- Agent continues working (just with less context)
- No confusing synthetic error results
- User may need to repeat their last request

The truncation is logged with details about which tool call IDs were
missing, helping track and diagnose the root cause.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 02:15:51 +05:30
Peter Steinberger
6d16a658e5 refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00
Peter Steinberger
c379191f80 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00
Peter Steinberger
f5d5661adf fix: guard session tool results 2026-01-12 17:28:46 +00:00
Peter Steinberger
6668805aca fix(agents): enforce single-writer session files 2026-01-11 02:25:45 +00:00
Peter Steinberger
08cc8f2281 refactor(agents): extract transcript repair module 2026-01-10 22:07:25 +00:00