small gleam coding and persistent agent daemon with a detachable cli and a canvas ui albedo.sh

Cancelling in the middle of an agent turn results in tool calls not being persisted #40

Open homosexual.cat
Open opened by homosexual.cat

On albedo 5fdfb65303e68be7fb9c03fd31ca1bfa6abf9cfb, if you cancel within the middle of an agent turn (e.g. if it's thinking and also running tool calls), the tool call results disappear/are no longer persisted into the database.

It's possible this is intentional and good, but if not, I think it's useful to have a record of ~every tool call, even if the turn is discarded, which I've seen other harnesses do by simply not discarding them.

Happy to be very off base here, though.

okami.mom

oh this shouldn’t be intended i really do believe in logging and tracking everything just for monitoribility. i think most likely the issue is that we’re not committing them as they happen but rather on turn end

okami.mom

ok yeah we only commit as each thing finishes and not for interruptions and this does explain a separate thing i noticed where if the first reasoning bit the model does gets interrupted/aborted because of network conditions or whatever, and then retired, it would reason from scratch again. i think we can maybe discard in-flight tool calls with a marker and then continue reasoning from where it left off

okami.mom

granted some providers are very picky about this stuff so maybe itll have to restart from a user turn

and as expected if i try to return claude's prior interrupted thinking back to it it just gets api blocked as "reasoning extraction" so thats fun

up to 1496eec1 there should be good turn salvaging for events like this. in flight tools and reasoning that abort for any reason will properly persist to the database. for the the transcript that the model continues from in flight is discarded with a note that effects are unknown and the model should check what happened.

Sign up or Sign in to add to the discussion.