Skip to content

Guard campaign relay providers with native admission - #1691

Open
4444J99 wants to merge 2 commits into
mainfrom
codex/relay-native-admission-20260730
Open

Guard campaign relay providers with native admission#1691
4444J99 wants to merge 2 commits into
mainfrom
codex/relay-native-admission-20260730

Conversation

@4444J99

@4444J99 4444J99 commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • require relay candidates to advertise a local checkout, execute and local-worktree capabilities, and a supported native transport
  • acquire machine-wide heavy admission before any provider command can execute
  • preserve the relay's exact PID/exec proof while a detached supervisor refreshes and releases that PID-bound lease for the provider's full lifetime
  • record the exact occupied, pressure, or admission-infrastructure gate when launch is denied

Root cause

The merged campaign relay treated an ianva-* transport as sufficient even for remote-only lanes. Its provider launch also bypassed the authoritative machine-wide heavy gate; a lexical lease around Popen would have released when the finite startup controller returned, before the long-lived provider exited.

Validation

Exact head: 120f4816e4e22cc5d7af990b0f1443bc2aaba17e
Exact tree: a70337d3f5c83f023e77b134da4b8f1fc21cdaaa

  • PYTHONPATH=cli/src python3 -m pytest -q cli/tests/test_campaign_relay_native_admission.py — 9 passed
  • representative end-to-end relay effector — 1 passed
  • focused mypy on the changed admission module — passed; the CI-reported callable-default mismatch is corrected through a narrow typed os.execvpe adapter
  • scoped cheap wave — syntax, diff hygiene, parameter/test hygiene, Ruff lint, and Ruff format all passed
  • scoped heavy wave — admission denied before start with pressure-sensor-unavailable; remote CI owns those shards asynchronously

Review provenance

Addresses the unresolved native-lane and host-admission findings on #1669:

No live provider, peer session, host configuration, credential, or signer state was inspected or changed.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@4444J99, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e0b947b4-3f90-45f2-adfd-668136012736

📥 Commits

Reviewing files that changed from the base of the PR and between 1bda0f8 and 120f481.

📒 Files selected for processing (4)
  • cli/src/limen/conduct/campaign_relay_admission.py
  • cli/src/limen/conduct/campaign_relay_process.py
  • cli/tests/test_campaign_relay_effector.py
  • cli/tests/test_campaign_relay_native_admission.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Multi-agent review roll call
@codex review

(CodeRabbit and Claude review automatically. Reviewers: post substantive findings only. Authors/agents: address every thread, push fixes to this branch, reply and resolve, then re-request review.)

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 492c253102

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +453 to +454
def _read_admission_handshake(descriptor: int) -> dict[str, Any]:
deadline = time.monotonic() + ADMISSION_HANDSHAKE_SECONDS

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bound admission by the relay startup deadline

When launch_reserved_relay is called with a startup timeout below 10 seconds, this creates a fresh independent 10-second deadline, so a stalled admission wrapper can exceed the caller's absolute deadline. The subsequent spawn-error terminalization still uses the already-expired outer deadline and can raise relay_startup_timeout instead of returning the durable terminal RelayLaunch receipt. Pass the outer deadline through the process factory and clamp this wait to its remaining budget.

AGENTS.md reference: AGENTS.md:L406-L408

Useful? React with 👍 / 👎.

Comment on lines +97 to +100
observed_identity = identity(provider_pid)
if observed_identity is None:
# An unavailable identity is never authority to release another process's lease.
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep monitoring after transient identity failures

If a single identity probe transiently returns None while the provider is still alive, the detached monitor exits permanently without releasing or refreshing the lease. Once the finite TTL elapses, _cleanup reaps that lease as stale even though the provider continues running, allowing another heavy surface to acquire admission concurrently. Treat an unavailable identity as a bounded retry condition rather than terminating the refresher.

AGENTS.md reference: AGENTS.md:L459-L467

Useful? React with 👍 / 👎.

Comment on lines +524 to +528
_terminalize_relay(
root,
relay_id,
state="failed",
code=_admission_terminal_code(reasons),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the relay attempt on transient admission denial

When admission is denied before provider execution for a temporary gate such as heavy-lease-held, vitals-shed, or an unavailable pressure sensor, this terminalizes the already-claimed relay as failed. Because failed belongs to _TERMINAL_STATES, every later launch of the same deterministic relay returns that receipt without retrying, so a momentary host condition permanently prevents the required successor from starting. Keep pre-exec admission denials reserved and retryable rather than consuming the relay's sole attempt.

AGENTS.md reference: AGENTS.md:L422-L431

Useful? React with 👍 / 👎.

@4444J99 4444J99 added the lifecycle:blocked Delivery intent exists but an explicit external or technical gate blocks it label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lifecycle:blocked Delivery intent exists but an explicit external or technical gate blocks it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant