IDKMesh

Jules automatic-routing reconciliation and throughput hardening — 2026-09-23

Owner requirements

The project owner asked to continue hardening the Google Jules integration so IDKMesh can develop quickly, automatically route simple coding work, and keep the complete operating model documented in the repository.

Repository findings

Current main already contained an API-backed Jules dispatcher, but the live router/dispatcher contracts had diverged after later repairs:

  1. .github/workflows/issue-model-router.yml emitted agent:jules-eligible and invoked jules-dispatch.yml with a workflow_dispatch input named issue_number.
  2. .github/workflows/jules-dispatch.yml no longer declared that input.
  3. config/jules-dispatch.json accepted only agent-ready, so the router’s automatic eligibility label no longer entered the dispatcher queue.
  4. routine dispatch had also reintroduced label bootstrapping and repeated per-label GitHub issue-list calls, despite earlier live rate-limit evidence.
  5. issue #753 demonstrated successful REST session creation but remained QUEUED without a PR for hours; the repository had no automatic stale/failed-session reconciliation.

These failures explain why a connected Jules installation can still appear idle even when the provider credential and REST session creation work.

Durable design

IDKMesh now distinguishes two execution ingress paths:

Both routes remain subject to the same hard-veto labels, capacity controls, duplicate-session protection, normal CI, and no-auto-merge rule.

The router-to-dispatcher handoff now uses a local reusable workflow through typed workflow_call.issue_number. This avoids relying on recursive GITHUB_TOKEN events and lets GitHub validate the caller/callee input contract before execution. A stdlib-only tools/check_jules_contract.py guard is also part of the required PR Gate so label-policy drift, missing reusable inputs, or privilege expansion becomes a merge-blocking failure.

Provider-session reconciliation

The Jules API documents these session states:

References:

The repository policy adds agent:jules-needs-attention. Reconciliation adds that blocking label and removes agent:jules-dispatched when a session:

The blocking label is added before the active reservation is removed, so the issue cannot become automatically redispatchable during the transition. Reconciliation never creates a replacement provider session.

Current initial thresholds are:

These are operational defaults to measure and revise, not claims about normal Jules service latency.

Throughput and API-pressure decisions

The repository-side concurrency cap remains four active Jules issues, with at most two new dispatches in a recovery sweep.

For lower API pressure and faster batches:

Completed Jules work continues to occupy its issue slot until the issue closes, preserving review backpressure. Failed/stalled work is quarantined and frees its slot so unrelated bounded work can continue.

Implementation artifacts

Tracked under issue #768:

Verification boundary

The local execution container could not resolve github.com, so it could not clone the branch for local pytest execution. The implementation therefore must be validated by the normal IDKMesh pull-request gate on the exact branch head before integration.

The Jules REST API remains an external alpha contract. Provider behavior is observed evidence, not repository authority. Jules output never self-verifies and no dispatcher path merges to main.

Regression-prevention contract

The durable fix is intentionally stronger than repairing the current workflow pair:

This specifically prevents the failure mode where one PR removes the issue_number input or stops accepting agent:jules-eligible while the other side continues assuming those contracts exist.

Provider-capacity follow-up

After the typed-contract repair merged, live execution proved the automatic lane was functioning: IDKMesh created three new Jules sessions without manual starts for issues #652, #669, and #643. The next session-create request was rejected by Jules with HTTP 400 and provider status FAILED_PRECONDITION.

The current official Jules limits page documents 15 daily tasks and 3 concurrent tasks for the base Jules plan. IDKMesh had independently retained a repository review/backpressure cap of four, so the provider limit was the stricter runtime boundary.

Issue #788 makes that distinction durable:

This allows a Jules plan upgrade to be represented as a reviewed policy change instead of a code rewrite, while provider-side tasks outside IDKMesh remain safe because explicit provider rejection is still handled as backpressure.