Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/reference/orchestrator-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ The orchestrator manages the Context PR end-to-end (create branch, commit refine

**Observability:** If the context PR hook runs but does not open a PR, the wrapper at `_maybe_open_base_pr_for_plan_to_implement` surfaces a `context_pr.failed` event (the inner hook raised) or `context_pr.skipped` event (the inner hook returned without raising, but the post-hook contract still records `contract.pr.context_pr_number = null`) on three sinks (#2611): the in-process `MessageStore` (so the event shows up as a `CONTEXT_PR_FAILED` / `CONTEXT_PR_SKIPPED` entry in `recent_messages` and `/pipelines/<id>/messages`), the `EventBus` (so `/status/wait` long-pollers wake — both event types are in `_STATUS_WAIT_EVENT_TYPES`, and the message types are in `_STATUS_WAIT_MESSAGE_TYPES`), and the legacy `StatusReporter` handler chain (no production handler is registered today, but the call is preserved for any future console/file handler). The emit branch is gated on `pipeline.repo` and `pipeline.base_branch` both being truthy; local-mode pipelines (no remote, no base branch) skip the hook silently and produce neither event (#2593).

The wrapper also writes structured log lines on every invocation: `Context PR hook entered (#2548)` on entry, followed by either a short-circuit log line from the inner hook (e.g. `Context PR hook: pipeline has no remote repo, skipping`) or the wrapper's `Context PR hook raised at plan→implement transition (continuing) (#2548)` warning when the inner hook raised. (CUSTOM-mode pipelines short-circuit in the wrapper before the inner hook runs and instead emit `Context PR hook skipped (CUSTOM mode) (#2548)`; this only matters for log forensics on stuck pipelines, since CUSTOM-mode pipelines are single-phase (#1762) and never traverse plan→implement in normal operation.) The `context_pr.skipped` case corresponds to an inner contract-side short-circuit that did not raise — for example, no `pr` block on the contract, the post-hook contract reload failed, or a late `save_contract` failure swallowed the success after the gateway already opened the PR on GitHub.
The wrapper also writes structured log lines on every invocation: `Context PR hook entered (#2548)` on entry, followed by either a short-circuit log line from the inner hook (e.g. `Context PR hook: pipeline has no remote repo, skipping`) or the wrapper's `Context PR hook raised at plan→implement transition (continuing) (#2548)` warning when the inner hook raised. (CUSTOM-mode pipelines short-circuit in the wrapper before the inner hook runs and instead emit `Context PR hook skipped (CUSTOM mode) (#2548)`; this only matters for log forensics on stuck pipelines, since CUSTOM-mode pipelines are single-phase (#1762) and never traverse plan→implement in normal operation.) The `context_pr.skipped` case corresponds to an inner contract-side short-circuit that did not raise — for example, no `pr` block on the contract, the post-hook contract reload failed, or a late `save_contract` failure swallowed the success after the gateway already opened the PR on GitHub. A missing `WORKTREE_BASE_DIR` volume mount is another `context_pr.skipped` trigger: the hook falls back to `/tmp` (gateway-rejected path), logs `Context PR hook: WORKTREE_BASE_DIR missing — falling back to system temp (likely a broken volume mount in production…) (#2684)` at WARNING level, and the gateway silently rejects the push (#2684).

In any of these cases, check `contract.pr.context_pr_number` (via `egg-contract show`) and the remote PR list before concluding the PR is missing — that last short-circuit can leave a PR open on GitHub while the contract still records `null`. **Pipeline deletion does not clean up Context PRs:** `egg-orch pipeline delete <id>` only removes the pipeline tip branch (`egg/<id>/work`) and per-container worktree branches; the Context PR branch (`egg/<id>/context`) is a sibling of the pipeline tip — same convention as the slice integration branches `egg/<id>/slice-N` — and is **not** deleted (see `_cleanup_remote_branches` in `orchestrator/routes/pipelines.py`). To remove a Context PR opened by an unwanted run the operator must close the PR and delete the branch manually:

Expand All @@ -470,7 +470,7 @@ gh pr close <context_pr_number>
git push origin --delete egg/<pipeline-id>/context # (gateway-mediated push)
```

Per-slice implement-phase BRC history files written by the orchestrator (`.egg-state/brc-history/<id>-implement-slice-<N>.{md,json}` plus `<id>-implement-unattributed.{md,json}`) are visible in each slice PR's diff; the aggregate `<id>-implement.{md,json}` file is **not** produced in slice-aware mode. Babysit-pr and other non-slice runs continue to emit the single content-addressed file (`pr-<N>-<short-sha>-implement.{md,json}` for babysit). See [Orchestrator Architecture: BRC-history file naming](../architecture/orchestrator.md#brc-history-file-naming) for the full file-pattern table.
Per-slice implement-phase BRC history files written by the orchestrator (`.egg-state/brc-history/<id>-implement-slice-<N>.{md,json}` plus `<id>-implement-unattributed.{md,json}`) are visible in each slice PR's diff; the aggregate `<id>-implement.{md,json}` file is **not** produced in slice-aware mode. Babysit-pr and other non-slice runs continue to emit the single content-addressed file (`pr-<N>-<short-sha>-implement.{md,json}` for babysit). See [Orchestrator Architecture: BRC-history file naming](../architecture/orchestrator.md#brc-history-file-naming) for the full file-pattern table. If the BRC history file is absent from a slice PR's diff, check orchestrator logs for `Per-slice BRC commit: WORKTREE_BASE_DIR missing — falling back to system temp…` — this WARNING indicates the `/home/egg/.egg-worktrees` volume is not mounted on the orchestrator pod, causing the gateway to reject the push (#2684).

## Related CLIs

Expand Down
Loading