Skip to content

API Reference parrot.integrations.devloop.service

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.integrations.devloop.service

View source

Channel-neutral dispatch service (spec §3 Module 8, FEAT-555).

Alias BridgeResult

Re-exported from parrot.integrations.devloop.models.BridgeResult.

Alias DevLoopCommand

Re-exported from parrot.integrations.devloop.models.DevLoopCommand.

Class DevLoopDispatchService

Owns the run lifecycle: confirm → spawn → tail → gates → terminal; enforces initiator ownership.

Parameter Type Default Description
config DevLoopIntegrationConfig
transport DevLoopTransport
redis Any
identity_resolver Optional[IdentityResolver] None
jira_toolkit Any None

Method DevLoopDispatchService.start

Re-attach every live record.

Probes each record's command endpoint; reachable ⇒ resume its tail from last_seen_seq; unreachable ⇒ mark it failed and post a terminal process_exited message (spec §7 "Re-attach on start", AC13).

start() -> None

Method DevLoopDispatchService.stop

Cancel tail/supervisor tasks only. Children keep running (G7).

stop() -> None

Method DevLoopDispatchService.dispatch

Build the brief for both kinds and park it behind a confirm card (Q1).

Nothing is spawned here — :meth:confirm launches the run.

dispatch(command: DevLoopCommand, requester: Requester, channel_id: str) -> str

Parameter Type Default Description
command DevLoopCommand The parsed /devloop command (action == "dispatch").
requester Requester The channel-neutral identity of the caller.
channel_id str The channel the command was issued in.

Returns: str — The minted pending_id.

Raises:

  • pydantic.ValidationError — The built brief fails validation.
  • DevLoopError — config.max_concurrent_runs is reached.

Method DevLoopDispatchService.record

In-memory lookup only (no Redis) — safe inside a Slack 3s ack / trigger_id window.

record(run_id: str) -> Optional[RunRecord]

Parameter Type Default Description
run_id str

Returns: Optional[RunRecord]

Method DevLoopDispatchService.pending

Look up a not-yet-confirmed dispatch by its pending id.

pending(pending_id: str) -> Optional[PendingConfirmation]

Parameter Type Default Description
pending_id str

Returns: Optional[PendingConfirmation]

Method DevLoopDispatchService.record_by_thread

Match RunRecord.channel_id + thread_ts (thread-reply interceptor).

record_by_thread(channel_id: str, thread_ts: str) -> Optional[RunRecord]

Parameter Type Default Description
channel_id str
thread_ts str

Returns: Optional[RunRecord]

Method DevLoopDispatchService.confirm

Launch a previously-parked dispatch.

confirm(pending_id: str, requester: Requester, overrides: Optional[Dict[str, Any]] = None) -> RunRecord

Parameter Type Default Description
pending_id str The pending confirmation's id.
requester Requester The caller — must be the original requester.
overrides Optional[Dict[str, Any]] None Optional Edit-modal field overrides, re-validated against the brief model.

Returns: RunRecord — The launched :class:RunRecord.

Raises:

  • RunNotFoundError — No such pending confirmation (or it expired).
  • NotRunOwnerError — requester did not originate the dispatch.

Method DevLoopDispatchService.discard

Drop a pending confirmation without launching it.

discard(pending_id: str, requester: Requester) -> None

Parameter Type Default Description
pending_id str The pending confirmation's id.
requester Requester The caller — must be the original requester.

Raises:

  • RunNotFoundError — No such pending confirmation (or it expired).
  • NotRunOwnerError — requester did not originate the dispatch.

Method DevLoopDispatchService.answer_gate

Approve an open_questions gate with structured answers.

answer_gate(run_id: str, gate_id: str, requester: Requester, answers: Dict[str, str]) -> BridgeResult

Parameter Type Default Description
run_id str
gate_id str
requester Requester
answers Dict[str, str]

Returns: BridgeResult

Method DevLoopDispatchService.resolve_gate

Approve or reject any other gate kind, with an optional comment.

resolve_gate(run_id: str, gate_id: str, requester: Requester, resolution: str, comment: str = '') -> BridgeResult

Parameter Type Default Description
run_id str
gate_id str
requester Requester
resolution str
comment str ''

Returns: BridgeResult

Method DevLoopDispatchService.cancel

Cancel a run; escalate to terminate() if it does not exit in time (S7).

cancel(run_id: str, requester: Requester) -> BridgeResult

Parameter Type Default Description
run_id str The run to cancel.
requester Requester The caller — must be the run's initiator.

Returns: BridgeResult — The bridge result of the cancel POST.

Method DevLoopDispatchService.status

List every run the caller initiated.

status(requester: Requester) -> List[RunRecord]

Parameter Type Default Description
requester Requester

Returns: List[RunRecord]

Method DevLoopDispatchService.pending_gate

The run's current pending gate, if any.

pending_gate(run_id: str) -> Optional[GateView]

Parameter Type Default Description
run_id str

Returns: Optional[GateView]

Alias DevLoopError

Re-exported from parrot.integrations.devloop.models.DevLoopError.

Alias DevLoopIntegrationConfig

Re-exported from parrot.integrations.devloop.models.DevLoopIntegrationConfig.

Alias DevLoopTransport

Re-exported from parrot.integrations.devloop.transport.DevLoopTransport.

Alias DevRequestBrief

Re-exported from parrot.flows.dev_flow.models.DevRequestBrief.

Alias GateError

Re-exported from parrot.bots.flows.core.gates.GateError.

Alias GateView

Re-exported from parrot.integrations.devloop.models.GateView.

Alias HeadlessRunProcess

Re-exported from parrot.integrations.devloop.process.HeadlessRunProcess.

Attribute IdentityResolver

Alias LoopbackRestChannel

Re-exported from parrot.integrations.devloop.bridge.LoopbackRestChannel.

Alias NotRunOwnerError

Re-exported from parrot.integrations.devloop.models.NotRunOwnerError.

Alias PendingConfirmation

Re-exported from parrot.integrations.devloop.models.PendingConfirmation.

Alias RequestType

Re-exported from parrot.integrations.devloop.models.RequestType.

Alias Requester

Re-exported from parrot.integrations.devloop.models.Requester.

Alias RunCommandChannel

Re-exported from parrot.integrations.devloop.bridge.RunCommandChannel.

Alias RunEvent

Re-exported from parrot.integrations.devloop.models.RunEvent.

Alias RunNotFoundError

Re-exported from parrot.integrations.devloop.models.RunNotFoundError.

Alias RunRecord

Re-exported from parrot.integrations.devloop.models.RunRecord.

Alias RunRegistry

Re-exported from parrot.integrations.devloop.registry.RunRegistry.

Alias RunStateTail

Re-exported from parrot.integrations.devloop.tail.RunStateTail.

Alias SpawnError

Re-exported from parrot.integrations.devloop.models.SpawnError.

Alias WorkBrief

Re-exported from parrot.flows.dev_loop.WorkBrief.

Alias brief_summary_fields

Re-exported from parrot.integrations.devloop.briefs.brief_summary_fields.

Alias brief_to_file

Re-exported from parrot.integrations.devloop.briefs.brief_to_file.

Alias build_bug_brief

Re-exported from parrot.integrations.devloop.briefs.build_bug_brief.

Alias build_feature_brief

Re-exported from parrot.integrations.devloop.briefs.build_feature_brief.

Alias default_identities

Re-exported from parrot.cli.devloop.bootstrap.default_identities.

Alias gate_error_result

Re-exported from parrot.integrations.devloop.bridge.gate_error_result.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally