✨ feat(runtime): observe CPA readiness with safe health probes - #780
Merged
Merged
Conversation
Compute Embedded status on demand from the owned CPA child and a bounded loopback HEAD /healthz probe. Fence results with a process-local child instance so exit or Restart cannot mark a replacement ready. Preserve lifecycle, journal and RuntimeGeneration semantics without using Management credentials. Allow ready observations without a version while retaining the External adapter's authenticated version requirement. Verify Supervisor focused/full/race/vet, Manager focused/full, Linux amd64/arm64 and Windows amd64 builds, and architecture boundaries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Configured Embedded Runtime status previously stayed
unknownafter lifecycle operations. Compute readiness on demand from the owned CPA child and a bounded localHEAD /healthzprobe, fencing each result to the same child instance.Allow Manager to consume
readywithout an observed version because the safe health route provides none. This Runtime 10 slice starts exactly atv2@80a49128ef64a8d058bc1acd0d2344cfd8fcd7b8.Scope
Runtime Supervisor implementation and regression tests are included.
Changes
CPAMP_RUNTIME_CPA_ADDR, default127.0.0.1:8317; reject invalid/non-loopback addresses. Use a fixed/healthzpath, HTTP 200 only, a 1-second timeout, direct transport withProxy=nil, fresh connections, and no redirects.start,stop,restartcapabilities.readywith an emptyCPAObservedVersion; retain nonempty observations verbatim and the External adapter's existing authenticated version requirement.unknownofflinestarting/healthzHTTP 200readyUser Impact
Authenticated Embedded status reports local CPA availability. Start and Restart still complete at spawn/ownership publication; callers observe readiness separately through status.
Compatibility / Runtime Notes
Data / Security Notes
CPA Management Key authority stays with Manager encrypted storage. The probe does not receive Management credentials, contact
/v0/management/*, trigger intentional Management authentication failures, or forward caller credentials. Supervisor does not read Manager DB/product configuration ordata.key.Status does not write the operation journal. Child instance identity is excluded from JSON and is neither PID authority nor RuntimeGeneration. CPA observed version remains empty rather than using configuration or health-response headers as a substitute.
Historical Asset Review
feat/integrated-cpa-runtimelocal health checks ininternal/managedruntime/controller.go,waitComponentRestart/healthyOnceinupdate.go, and its process restart/backoff mechanics; source authorship was checked.Risk / Rollback
Risk level: Medium
Concurrency and readiness interpretation are the main risks; real child and journal tests verify replacement fencing and unchanged operation evidence. Roll back by reverting this commit to the prior static Embedded status and Manager validation contract.
Verification
All local checks below passed with Go 1.26.1 on darwin/amd64, using isolated temporary data/cache and fixture loopback listeners. UI/TypeScript checks are not applicable. CI results are tracked by the PR checks.
Local self-review found no blocking defects. Linux amd64/arm64 and Windows amd64 outputs were confirmed as the intended binary formats; these are cross-build checks, not execution on those operating systems.
Screenshots / Recordings
N/A — backend protocol and ADR changes.
Docs
Docs decision: ADR-0001 is amended for the accepted readiness/version contract. Public manual, demo, and release changes are not needed for this Supervisor-private foundation slice.
cpamp-planremains untouched.Related
Refs #779 (Runtime 09 baseline), Runtime 10 Observed Readiness + Safe CPA Health Probe, and ADR-0001.
CPA upstream evidence at
router-for-me/CLIProxyAPI@7bbfeaf8a7acf2cd5a834dcb0842539fe6aabc2b: safe health routes and Management authentication/IP-ban behavior.Ready for independent acceptance; no automatic merge or subsequent Runtime task is requested.