Skip to content

feat(runtime): opt-in authoritative Hermes terminal turn probe - #178

Closed
chriscoveries wants to merge 7 commits into
ChesterRa:mainfrom
chriscoveries:feat/hermes-turn-probe
Closed

chriscoveries wants to merge 7 commits into
ChesterRa:mainfrom
chriscoveries:feat/hermes-turn-probe

Conversation

@chriscoveries

Copy link
Copy Markdown
Contributor

Native terminal actors currently report waiting / pty_running_state_unknown even during an active turn. Add a per-actor turn_probe setting (off by default, auto, or hermes_turn_lease) so supported Hermes CLI actors can expose provider-backed working and idle observations through the existing effective_working_* fields. Settings take effect on the next actor start; managed sessions retain precedence.

The Linux adapter reads only Hermes schema-31 lease and session metadata, using a read-only database connection and bounded queries. An active lease must belong to the actor's process tree, PID namespace and current process generation. Idle requires a previously observed owned lease, the same still-live holder, an open bound session and no active owned lease. Missing, unsupported or ambiguous metadata remains Unknown and preserves today's behavior. Terminal output and quiet time never establish turn state. The runtime remains a terminal actor; this change does not add dispatch policy or another runtime adapter.

Verification used GitHub Actions on the fork and an isolated stage:

  • CI run 39849090148 passed all six jobs, including rust-linux, at exact head d3cb0464c5e2c564a028aa1e9afff2467b62457a: 2,732 Rust tests passed, 58 skipped. Tests use captured metadata-only Hermes state and cover ownership, generation, fallback, profile and managed-session precedence controls. The branch includes the real-Chrome filter prerequisite from test(ci): route current ChatGPT browser fixtures to nightly #175.
  • Regression run 39844074857 compiled and failed the expected assertion: an owned captured Hermes turn returned waiting instead of working. This control retains the new capture/test harness but uses the unchanged upstream production working-state projection.
  • Release run 39870988973 built the same source head. The deployed standalone binary's SHA-256 was d1c395ec8e6a5d386138aa9436ef5ae09afd1fdd09307d2fb3fef80ad9fec301.
  • Real Hermes turns with model usage and terminal-tool calls passed the on/off controls. Off remained native waiting across 17 owned-lease samples, including 15 after saving auto. A fresh enabled generation first remained Unknown, then reported Working across 16 lease samples, including 14 after saving off, and Idle across two post-release samples with the same live holder and open session. A new off generation restored native fallback. The traced daemon made nine provider-database opens in the enabled control window and zero in the off window.
  • All 136 collected metadata files matched their SHA manifest (7c121fd990b8f636e2e847ba47446bd13466290ba6623e1777e50daa08f04a9b), and actor.activity records corroborated the transitions. Earlier incomplete setup/provider attempts remain recorded as failures. No provider message bodies or credentials were included. The previous stage binary and actor roster were restored afterward.

@chriscoveries

Copy link
Copy Markdown
Contributor Author

CI note: on current main, rust-linux fails the five real-Chrome fixtures added in 1e5651b2 on every pull request. #175 moves them to the nightly job.

@ChesterRa

Copy link
Copy Markdown
Owner

Thank you for the substantial investigation and validation here! The ownership checks, default-off behavior, and separation from terminal-output heuristics are thoughtful.

After reviewing the integration cost, we’ve decided not to take this adapter forward. It depends on Hermes database schema and holder-format details, together with Linux process inspection. The schema-31 restriction versus schema 32 in Hermes v0.22.4 already illustrates the ongoing compatibility burden.

We’re also not comfortable treating lease expiry alone as authoritative evidence that a turn has finished settling.

This is an integration-boundary decision, rather than a request for more tests or version guards. I don’t want to ask you to keep expanding a compatibility layer that we’re unlikely to maintain.

I’d prefer to close this PR for now and revisit the goal if a supported status interface becomes available. For native terminals, we’ll keep output observations separate from authoritative turn state. Thank you again for exploring this carefully.

@chriscoveries

Copy link
Copy Markdown
Contributor Author

Understood. We'll close this PR for now. Maintaining Hermes's database schema and holder format would make CCCC responsible for an unsupported integration, and lease expiry is not a reliable settlement signal. Native-terminal output observations should remain separate from authoritative turn state. We can revisit this if Hermes exposes a supported status interface. Thank you for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants