Describe the Bug
With @flue/runtime 2.0.3, a durable submission can settle as failed after it has already produced a complete assistant response and threshold compaction succeeds.
The durable submission error is:
Cannot continue from message role: assistant
Observed event order:
- Several model/tool cycles complete successfully.
- A final assistant message completes with
stopReason: "stop".
- Threshold compaction emits a canonical compaction record parented to that assistant message.
- A resource snapshot is emitted.
- 57 ms later, the submission settles as failed with the error above.
There was no tool or model failure. The completed response used about 38.7k total model tokens. This happened twice in adjacent production submissions.
The agent declares useAgentStart and useResponseFinish, but no useAgentFinish, so no finish-hook continuation was expected.
Possible investigation points in v2.0.3:
I do not have the internal stack trace, so the exact continuation entry point remains unconfirmed.
Expected Behavior
After a successful assistant response and successful threshold compaction, the submission should settle as completed and retain the assistant response. No further model turn should start unless new user/signal/join input exists.
Steps to Reproduce
- Use
@flue/runtime 2.0.3 with durable Postgres submissions and threshold compaction enabled.
- Run a multi-tool conversation until a successful assistant turn crosses the compaction threshold.
- Let threshold compaction complete after the assistant's
stop response.
- Inspect the durable submission settlement.
Observed result: compaction completes, then the submission fails with Cannot continue from message role: assistant.
Environment:
@flue/runtime: 2.0.3
@flue/postgres: 2.0.3
@earendil-works/pi-agent-core: 0.83.0
- Node.js: 24.x
Describe the Bug
With
@flue/runtime2.0.3, a durable submission can settle as failed after it has already produced a complete assistant response and threshold compaction succeeds.The durable submission error is:
Observed event order:
stopReason: "stop".There was no tool or model failure. The completed response used about 38.7k total model tokens. This happened twice in adjacent production submissions.
The agent declares
useAgentStartanduseResponseFinish, but nouseAgentFinish, so no finish-hook continuation was expected.Possible investigation points in v2.0.3:
runModelTurnWithRecovery()performs threshold compaction and then returns.runWouldStopPhase()continuation paths callagentLoop.continue().continueRebuilt()only avoids continuing from an assistant leaf when arestartcallback was supplied.I do not have the internal stack trace, so the exact continuation entry point remains unconfirmed.
Expected Behavior
After a successful assistant response and successful threshold compaction, the submission should settle as completed and retain the assistant response. No further model turn should start unless new user/signal/join input exists.
Steps to Reproduce
@flue/runtime2.0.3 with durable Postgres submissions and threshold compaction enabled.stopresponse.Observed result: compaction completes, then the submission fails with
Cannot continue from message role: assistant.Environment:
@flue/runtime: 2.0.3@flue/postgres: 2.0.3@earendil-works/pi-agent-core: 0.83.0