Skip to content

oxa orchestration: handle routine lab failures automatically (queue rejections, GitHub auth per machine, API budget) #61

Open

Description

@n0rpan

Owner decision O-391 (2026-11-17): routine failures must be handled by the orchestrator itself, not wait for a human. Today's lab scripts showed the gaps; the product orchestrator (oxa work / lead, see #34, #38, #23) must own these:

  1. Merge-queue rejection: detect it, find the failing tests of that merge_group run, tell the author on the PR with the next step (refresh on main), retry once automatically when main has moved; never silently park an approved PR.
  2. GitHub auth per machine: each worker machine gets a short-lived GitHub App installation token from the native broker (#819), with its own API budget; never the owner's personal login; automatic re-mint before expiry; separate apps/roles for workers vs orchestration (merge, labels).
  3. API budget hygiene: one list call per loop instead of per-item polling; detect and report the top API callers; back off before the hourly limit.
  4. Stalled lanes: a lane blocked on a review/read gets its next independent task instead of idling; the blocker is escalated once.
  5. Sign-in keep-alive: subscription tokens refreshed proactively before expiry with atomic rotation under a lock (see oxstack/ox-llm#740/#904).

Acceptance: each item has a deterministic runner behaviour and a test with a fake GitHub/provider; the orchestrator escalates only decisions that need the owner.

Activity

  1. n0rpan commented on Nov 17, 2026

    @n0rpan
    ContributorAuthor

    Owner O-428 (2026-11-17): today's lab failures become built-in invariants of the oxa orchestrator (oxa work / lead), enforced by code and tested against a fake GitHub, not by lab scripts or prompts. Each one is a regression scenario:

    1. Commit → push → PR is one step. A worker task is done only when its commits are on GitHub and a PR (draft OK) exists; the runner pushes on every commit and opens the PR after the first push. No stranded local commits, no branches without a PR (except declared evidence branches, auto-cleaned).
    2. Approval belongs to the PR's own diff, not the head SHA: a pure main merge keeps the approval (patch-id); any change to the own diff needs a new verdict.
    3. No silent removal: deleting existing source needs an explicit 'Removes: what — why'; the runner blocks otherwise.
    4. Merge-queue rejection → failing tests posted to the author, one automatic retry after main moves, alert on a second rejection; nothing parks silently.
    5. No pre-emptive main merges into approved PRs; the queue composes.
    6. Roles are separate: review workers only review, builders only build; review throughput is measured and alerts below a floor.
    7. Risk tiers decide who must review (docs/tests → automatic; product code → one independent review; security core → owner/orchestrator read). An unnecessary escalation is a rule bug to fix, not work to do.
    8. Stuck detection for: empty queue with ready PRs, queue entries waiting, CI runners saturated, main red, silent coordinator, review floor, stranded commits, orphan branches, new security alerts, outside PRs.
    9. Per-machine GitHub App identities with separate worker/orchestrator roles and their own API budgets; workflow-file changes need the orchestrator role.
    10. Landing-first scheduling: workers fix/refresh/land existing PRs before new intake; intake pauses above a backlog limit; big existing work is sliced, not rewritten; parked work is indexed (#946).
    11. Release focus mode: when a release is open, the critical-path item (here oxstack/ox-llm#824) gets the strongest workers and 30-min status; checklist boxes tick on merge+evidence automatically.

    Acceptance: each item has a deterministic runner behaviour, a fake-GitHub test, and a line in the orchestrator docs. A short agent-facing skill may explain the workflow, but the guarantees live in code.

  2. n0rpan commented on Nov 17, 2026

    @n0rpan
    ContributorAuthor

    Design input (O-447): the lab's flow review recommends replacing push-based assignment with one mechanical board derived from GitHub every few minutes: each open PR/issue gets exactly one next action (fix findings, fix red required CI, resolve conflict, add Removes:, wait for review, ready to land), a priority (release-pinned items first), and a lease; any idle worker or lane claims the top unleased action, with an attempt cap per PR per day and WIP limits. Drafts produced by workers are included and auto-promoted when required checks are green. The coordinator handles only exceptions and owner decisions. This is the target shape for oxa work.

  3. n0rpan commented on Nov 19, 2026

    @n0rpan
    ContributorAuthor

    Triage 2026-11-19: this issue is now tracked in #146 (Cluster: Lead control loop: act on stuck work, review-aware landing, lead-owned workers, priority P0), planned PR 4: "Routine failures handled". It will be fixed there together with its related issues, not one by one.

  4. transferred this issue fromon Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions