molecule-core/platform/internal/router
Molecule AI Backend Engineer 384bea6102 feat(checkpoints): Temporal crash-resume — GET latest checkpoint + history injection (#837, closes #583)
Adds the final step (3/3) of the durable Temporal resume path:

Platform (Go):
- `Latest` handler: GET /workspaces/:id/checkpoints/latest returns the
  most recently completed step across all workflows for the workspace,
  ordered by completed_at DESC. Returns 404 when no checkpoints exist.
- Router: registers the new route BEFORE the wildcard :wfid route to
  avoid shadowing; callerMismatch guard enforces workspace isolation.
- 4 new unit tests: 200, 500, 404 (ErrNoRows), and 403 (caller mismatch).

Workspace runtime (Python):
- `_fetch_latest_checkpoint()`: non-fatal async helper that GETs the
  new endpoint and returns the parsed dict, or None on 404 / any error.
- `TemporalWorkflowWrapper.run()`: on startup, fetches the latest
  checkpoint and prepends a synthetic [system, ...] entry to the
  serialised AgentTaskInput.history so the agent is aware of its prior
  crash state before receiving the current task.
- 4 new pytest tests: 404→None, 200→dict, exception→None (non-fatal
  contract), and end-to-end injection into AgentTaskInput.history.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 03:22:31 +00:00
..
admin_test_token_route_test.go fix(security): add AdminAuth to /admin/workspaces/:id/test-token route 2026-04-17 02:48:00 +00:00
canvas_proxy_test.go fix(test): wrap httptest.ResponseRecorder with CloseNotify for canvas proxy tests 2026-04-16 05:40:17 -07:00
canvas_proxy.go fix(security): strip Authorization + Cookie headers in canvas reverse proxy (closes #451) 2026-04-16 11:00:43 +00:00
router.go feat(checkpoints): Temporal crash-resume — GET latest checkpoint + history injection (#837, closes #583) 2026-04-18 03:22:31 +00:00