paperclip/packages/shared/src
Dotta fda296ee4f
[codex] Add configurable liveness auto-recovery controls (#4587)
## Thinking Path

> - Paperclip orchestrates AI agents for zero-human companies.
> - Heartbeat liveness recovery decides when stalled issue trees need
manager-visible follow-up.
> - Automatic recovery issue creation is useful, but operators need
instance-level controls for how aggressive it is.
> - Without controls, recovery behavior is harder to tune for local
development, production operations, and noisy edge cases.
> - This pull request adds configurable liveness auto-recovery settings
across shared contracts, API routes, services, and the instance
experimental settings UI.
> - The benefit is that operators can keep liveness findings advisory or
enable bounded recovery automation with explicit intervals and lookback
windows.

## What Changed

- Added shared types and validators for liveness auto-recovery settings.
- Extended instance settings routes and services to persist and validate
the new controls.
- Wired heartbeat/recovery services to honor enablement, minimum
interval, and lookback settings.
- Added UI controls for liveness recovery under instance experimental
settings.
- Covered the new server behavior with instance settings and liveness
escalation tests.

## Verification

- `pnpm exec vitest run --project @paperclipai/server
server/src/__tests__/heartbeat-issue-liveness-escalation.test.ts
server/src/__tests__/instance-settings-routes.test.ts --pool=forks
--poolOptions.forks.isolate=true`
- `pnpm --filter @paperclipai/shared typecheck`
- `pnpm --filter @paperclipai/server typecheck`
- `pnpm --filter @paperclipai/ui typecheck`

## Risks

- Moderate behavioral risk because recovery automation timing changes
when enabled; defaults keep existing advisory behavior unless the
setting is turned on.
- No database migration in this PR; settings are stored through the
existing instance settings path.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

- OpenAI Codex, `gpt-5`, coding model with tool use and local command
execution; context window not exposed by the runtime.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-27 08:46:44 -05:00
..
telemetry [codex] Harden execution reliability and heartbeat tooling (#3679) 2026-04-14 13:34:52 -05:00
types [codex] Add configurable liveness auto-recovery controls (#4587) 2026-04-27 08:46:44 -05:00
validators [codex] Add configurable liveness auto-recovery controls (#4587) 2026-04-27 08:46:44 -05:00
adapter-type.ts feat(adapters): external adapter plugin system with dynamic UI parser 2026-04-03 21:11:20 +01:00
adapter-types.test.ts Add first-class security agent role to taxonomy (#4532) 2026-04-26 07:52:05 -05:00
agent-url-key.ts feat: company portability — export/import companies and agents 2026-03-02 09:06:58 -06:00
api.ts [codex] Add issue subtree pause, cancel, and restore controls (#4332) 2026-04-23 14:51:46 -05:00
config-schema.ts Introduce bind presets for deployment setup 2026-04-11 07:09:07 -05:00
constants.ts Add first-class security agent role to taxonomy (#4532) 2026-04-26 07:52:05 -05:00
environment-support.test.ts Add sandbox environment support (#4415) 2026-04-24 12:15:53 -07:00
environment-support.ts Generalize sandbox provider core for plugin-only providers (#4449) 2026-04-24 18:03:41 -07:00
execution-workspace-guards.ts Guard closed isolated workspaces on issues 2026-04-04 17:48:54 -05:00
index.ts [codex] Add configurable liveness auto-recovery controls (#4587) 2026-04-27 08:46:44 -05:00
issue-references.test.ts Add first-class issue references (#4214) 2026-04-21 10:02:52 -05:00
issue-references.ts Add first-class issue references (#4214) 2026-04-21 10:02:52 -05:00
issue-thread-interactions.test.ts [codex] Add structured issue-thread interactions (#4244) 2026-04-21 20:15:11 -05:00
network-bind.ts Introduce bind presets for deployment setup 2026-04-11 07:09:07 -05:00
project-mentions.test.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
project-mentions.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
project-url-key.ts fix: append short UUID suffix to project slugs when non-ASCII characters are stripped to prevent slug collisions 2026-03-31 16:35:30 +00:00
routine-variables.test.ts Add draft routine defaults and run-time overrides 2026-04-09 10:19:52 -05:00
routine-variables.ts Add draft routine defaults and run-time overrides 2026-04-09 10:19:52 -05:00
workspace-commands.test.ts [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00
workspace-commands.ts [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00