You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 11f9abb
Browse filesBrowse the repository at this point in the historyBrowse files
merge(session): take the manual chat recovery fixes from fix/session-recovery-manual-chat
Bring the manual chat branch and everything below it into the automatic
recovery branch. That covers the recovery ticker, the revert refusal
reasons, the shared crash check, the snapshot boundary for failed
messages, and the chat changes for discarded turns.
Conflicts resolved:
- `go/core/internal/service/session/quiescence.go`: keep the recovery
scan on its own ticker. Each tick now calls `scanRecovery`, so the
automatic sweep runs there instead of on quiescence worker 0.
- `go/core/internal/service/session/recovery.go`: `Recovery` sets
`automatic` and uses `crashRecoveryAdmitted`, so it no longer requires
a RESUME operation. Keep `scanRecovery`, `recoverCrashedActors` and
`crashedActorSession`. Re-add the `uuid` import, which
`crashedActorSession` uses.
- `go/core/internal/service/session/workflow.go`: `actorClient` keeps
`ListActorsPage`. `RevertActor` comes from `substrate.LifecycleClient`.
- `go/core/internal/service/session/recovery_test.go` and
`recovery_observation_test.go`: take the lower branches' assertions and
pass the automatic recovery flag to every `NewActorWorkflow`. Apply
the observation test's unrecoverable-Actor expectation from
fix/session-recovery-observation.
- `proto/kagent/api/v1/sessions.proto`: keep `automatic = 2` and the
newer `failed_messages` comment. The generated Go and TypeScript
match `make proto-generate` output.
- `ui/src/components/chat/SessionRecoveryAlert.tsx`: manual mode follows
fix/session-recovery-manual-chat and offers only Revert, pointing at
the snapshot lines for Fork. Automatic mode keeps its progress title
and the Revert button. Fork stays on the snapshot lines, which render
in both modes, so the alert drops its own picker and `onFork`.
- `SessionRecoveryAlert.test.tsx` and `ChatTranscript.recovery.test.tsx`:
take the "Not remembered after recovery" assertions and add
`automatic` to each recovery value.
- `docs/architecture/runtime-and-lifecycle.md` and
`docs/lifecycle-retries.md`: keep the refusal reasons and the GetSession
observation, and state that automatic mode keeps both choices.
Verified on linux/amd64 with Go 1.27.3: `go build` and `go vet` over
`./core/...` and `./api/...`, pinned `gofmt` on the touched files,
`make lint` on the touched packages, and `go test` over the service,
substrate, database, grpcserver and mcp packages against Postgres
testcontainers. Verified the UI on Node 24 with `tsc --noEmit`,
eslint, and `vitest run src/components/chat src/pages src/api`.
Signed-off-by: Ada Lundhe <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: docs/lifecycle-retries.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,13 +54,25 @@ It discards runtime changes since that snapshot and does not replay input.
54
54
A runtime without a snapshot restarts from its initial state.
55
55
`GetSession.recovery.failed_messages` identifies user inputs absent from the
56
56
restored runtime by both task and message ID. Their public history remains
57
-
available, and chat marks them as failed to send.
57
+
available, and chat marks them "Not remembered after recovery". Only
58
+
`GetSession` returns `recovery`.
58
59
59
60
Retry an interrupted revert against the same Session ID. Pending recovery retains its operation across API restarts.
60
61
The lifecycle worker retries already admitted recoveries even after automatic recovery is disabled.
61
-
After recovery succeeds, another revert returns `FAILED_PRECONDITION` because the Actor is healthy.
62
62
Checkpoint creation returns `ABORTED` until it finishes.
63
63
A revert that observed the crash before another lifecycle operation began also returns `ABORTED`.
64
+
So does a revert while another lifecycle operation is active.
65
+
66
+
A revert that can never succeed against the Session as it stands returns `FAILED_PRECONDITION`.
67
+
Its `google.rpc.ErrorInfo` detail, in domain `kagent.dev`, names one of two reasons:
68
+
69
+
| Reason | Meaning | Client action |
70
+
| --- | --- | --- |
71
+
|`KAGENT_SESSION_RUNTIME_NOT_CRASHED`| The runtime is healthy or suspended. A retry after a revert whose response was lost lands here. | Treat as recovered and continue the conversation. |
72
+
|`KAGENT_SESSION_RUNTIME_UNRECOVERABLE`| The recorded Actor is missing, or a same-name Actor replaced it. | Stop retrying. Start another Session, or fork one from a checkpoint. |
73
+
74
+
A `FAILED_PRECONDITION` without either reason follows the general table below.
75
+
Read the reason rather than the message text, which is not stable.
0 commit comments