fix(lifecycle): classify native hello timeouts (#18216)

## Thinking Path

> - Paperclip verifies an agent's execution setup before it becomes
ready.
> - Native hello probes return a structured environment-test check.
> - A timeout uses the check suffix `_hello_probe_timeout`.
> - The lifecycle mapper only recognized the older
`_hello_probe_timed_out` spelling.
> - It therefore reported a native timeout as a generic test failure.
> - This change maps both spellings to the existing timeout category.
> - Operators receive the existing fixed timeout guidance without
provider output.

## Linked Issues or Issue Description

**What happened?**

On current main, `testNativeRunnerAuthentication` emits
`codex_hello_probe_timeout`. `assertHarnessTestPassed` classified it as
`harness_test_failed` instead of `harness_probe_timed_out`. The OpenCode
spelling in the unit table checks the generic suffix contract. It does
not add or qualify a native OpenCode producer on current main.

**Expected behavior**

Recognize the native producer's timeout code. Keep the existing timeout
category, legacy spelling, and fixed error text.

**Steps to reproduce**

Pass a failed environment result with the source-defined Codex timeout
code to `assertHarnessTestPassed`. The added owner controls fail before
the mapping change and pass afterward.

The related open #16652 changes a legacy Claude probe timeout and UI
behavior. It does not change this mapper.

## What Changed

- Accept `_hello_probe_timeout` beside the existing
`_hello_probe_timed_out` suffix.
- Cover the actual Codex producer spelling, the forward-compatible
OpenCode spelling, and a lookalike suffix that must remain a generic
failure.
- Retain existing authentication, model, command, directory,
unexpected-output and success handling.

## Verification

- The real owner unit suite produced **2 failing timeout cases and 25
passing controls** before the fix. The same suite passes **all 27
controls** after the fix under a focused local source-alias
configuration.
- Standard owning command: `pnpm --filter @paperclipai/server exec
vitest run src/__tests__/agent-harness-verification.test.ts`.
- Local scoped noEmit did not pass. Reused local dependency links
produced ambient Express declarations, missing `tar-stream`, and
mixed-source type errors. The initial load and typecheck failures are
preserved. Normal remote CI must supply the final typecheck and build
evidence.
- `git diff --check` passes. The diff contains only the mapper and its
existing unit test.
- Exact-head normal CI passed on `db56f63`: 55 successful checks, two
skipped checks and one neutral review check. Required `ci / verify`, `ci
/ e2e` and `ci / Build` passed. Greptile and the Paperclip reviewer both
report 5/5 with no findings or open threads. No CI rerun was needed.
Local noEmit setup remains a recorded limitation.
- Native probes, model calls, databases, application builds and
end-to-end journeys were not run locally. This source regression does
not establish the cause of any recorded evaluation failure.

## Risks

Low scope. The existing closed failure category changes for the native
timeout spelling. A string that only contains that suffix in the middle
still maps to generic failure. Authentication keeps priority. Failure
text stays fixed. This change preserves lifecycle ownership, deferral,
retry limits and deadlines.

## Model Used

OpenAI GPT-6 through Codex, with source analysis and pure unit tests.
The exact serving model ID and context-window size are not exposed to
this worker.

## 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 searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-12-01 04:00:56 +00:00
1 parent 66a8aa7f7e
commit c737187ec7
2 files changed
+4 -1

No files matched your search

@@ -14,6 +14,9 @@ describe("saved harness verification", () => {
["opencode_command_unresolvable", "harness_command_unavailable"],
["opencode_cwd_invalid", "harness_cwd_invalid"],
["opencode_hello_probe_timed_out", "harness_probe_timed_out"],
["codex_hello_probe_timeout", "harness_probe_timed_out"],
["opencode_hello_probe_timeout", "harness_probe_timed_out"],
["opencode_hello_probe_timeout_extra", "harness_test_failed"],
["opencode_hello_probe_unexpected_output", "harness_probe_unexpected_output"],
["private provider error", "harness_test_failed"],
])("classifies %s without keeping provider output", (checkCode, code) => {
@@ -63,7 +63,7 @@ export function assertHarnessTestPassed(result: AdapterEnvironmentTestResult) {
: has("_hello_probe_model_unavailable") || has("_model_invalid") ? "harness_model_unavailable"
: has("_command_unresolvable") ? "harness_command_unavailable"
: has("_cwd_invalid") ? "harness_cwd_invalid"
: has("_hello_probe_timed_out") ? "harness_probe_timed_out"
: has("_hello_probe_timed_out") || has("_hello_probe_timeout") ? "harness_probe_timed_out"
: has("_hello_probe_unexpected_output") ? "harness_probe_unexpected_output"
: "harness_test_failed";
throw Object.assign(new Error("The harness test failed"), { code });