Repository navigation
Description
Problem
Some executions are started while another execution is still holding its admission slot: an orchestrating goal starts and waits for implementation tasks; an automation run's container calls ProPR tools that launch an analysis in the API process. Admission has no notion of a parent, so each takes its own slot. If the parent holds its agent's only slot and the child needs the same agent, the child waits for the parent and the parent waits for the child (#3386). The same can already happen at the global level with a limit of one.
Goal
An explicit, documented rule for nested executions, enforced in admission, so that no supported configuration can deadlock.
Acceptance criteria
- An execution started on behalf of a running parent execution is identified as nested at the admission boundary, with the parent's holder identified reliably (not guessed from timing).
- The default rule: a nested execution on the same agent alias as its parent is charged under the parent's reservation and does not take a second slot of that alias; it still counts against other aliases' ceilings when it runs on a different agent. State clearly how it counts against the global limit, and make the choice so that a global limit of one with one nested level cannot deadlock.
- The parent's reservation is not released while a nested execution charged under it is still running, and a nested execution cannot outlive the fencing of its parent: when the parent is fenced or recovered, its nested executions are stopped and their containers removed before the capacity is reused.
- Nesting is bounded: define the depth and the number of nested executions one parent may carry, and refuse beyond that with a clear error instead of running unbounded work under one slot.
- If, after investigation, charging under the parent cannot be made safe for one of the paths, that path instead rejects the configuration at startup with a clear error naming the agent and the reason. Say in the PR which paths use which rule and why.
- The covered paths are at least: tasks started by an orchestrating goal while the goal session is running; analyses launched from the API process on behalf of an automation run's tool call (for example semantic repository search); auxiliary executions inside one job that run while the main container is alive, if any exist. Sequential auxiliary executions that run when no other container of the job is alive are not nested and take a normal slot.
- Diagnostics distinguish holders from nested executions charged under them.
- With no per-agent policy and no nested chain, behaviour is unchanged.
- Tests with real Redis and multiple processes: parent holding the only slot of an alias plus a nested execution on the same alias completes; nested on a different alias respects that alias's ceiling; parent crash stops and removes nested executions before reuse; the depth and count bounds; a global limit of one with one nested level.
Out of scope
- Changing which work goals or automations are allowed to start.
- Scheduling of plan graphs (covered by the scheduler work for [RFC] Autonomous Engineering Coordinator — Architecture and Contribution Guidance #3385).
Implementation
Key files: packages/core/src/agents/agentRunAdmission.ts (holder records, prepareAdmittedAgent, finish, recover), packages/core/src/claude/docker/dockerExecutionOwnership.ts (propr.task.id label, attempt generation, runWithExecutionAbortSignal / getExecutionOwnershipContext via AsyncLocalStorage: the existing way context reaches the launch boundary), packages/core/src/goals.ts (orchestrate goals start and monitor implementation tasks; the goal container holds its slot for the whole session), src/jobs/processGoalJob.ts, packages/core/src/queue/taskQueue.types.ts (IssueJobData has no goal or parent field), src/jobs/agentRuns/toolPolicy.ts and packages/api/mcp/agentRunGrants.ts (the MCP grant mounted in automation containers; record id <runId>:<phase> identifies the calling run), packages/api/mcp/toolsContext.ts (search_repository_files passes no run identity to retrieval), packages/core/src/services/repositoryRetrievalService.ts (searchSemantic uses the default agent), packages/core/src/services/relevance/semanticScorer.ts (parallel analysis chunks), docs/docs/architecture/agent-run-admission.md (states today that there is no logical-wrapper lease; live acceptance step "nested logical wrappers must not deadlock at N=2").
The parent link has to be carried explicitly: from the goal to the tasks it creates (job data), and from the automation run's grant to the API-side launch. Do not infer it from a shared task id label alone: in-job auxiliary analyses already share the parent's propr.task.id while running sequentially.
Tests: test/agentRunAdmission.test.ts and its fixtures, test/nativeGoalLaunchBoundary.test.ts, test/processGoalJob.test.ts, test/processAgentRunJob.test.ts. Verify with the standard commands.
Activity
propr-dev commentedon Nov 12, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53480/claude-opus-5-5-define-how-executions-sta-20261112-2255-lfx3478-epic-per-agent-9uvissue-3480-20261112-2255-claude-opus-5-5-lfx🔍 Track Task Execution