Skip to content

[Feature]: Check that the target agent is runnable before claiming a Task #156

Open

Description

@PerfectPan

Problem

Refuse to start a Task whose target agent is not runnable on this host, before the Task is claimed. Today start, run, resume, the TUI and the Rivus task-start tool hand a Task to its targetAgent without asking discovery; a missing or broken agent command fails only when its process starts, after the Task was claimed and moved to 执行中.

Proposed Solution

Check the target agent's discovery status in TaskStartService, before the claim, through one discovery-id map shared with init (claude-code → claude, codex → codex). When the agent is not runnable, refuse with its id, status and evidence summary and leave the Task Backend unchanged. Skip agents discovery does not know.

Blocked on: how fresh discovery must be before a start: probe on every start, once per process, or a TTL cache with manual refresh. Version probes add start latency, so this must be decided first. No part ships usefully without it: the shared id map (plan Task 1) is only a refactor until the check exists.

Acceptance Criteria

  • A Task targeting a runnable agent starts as today.
  • A Task targeting a missing agent is refused before the claim: non-zero exit with the agent id, status and evidence; status and claim fields unchanged.
  • An agent whose command has no discovery provider is not blocked.
  • The check reads no config file contents and starts no agent session; task-start maps a refusal to a stable error without host paths.

Design

Activity

  1. PerfectPan commented on Oct 18, 2026

    @PerfectPan
    OwnerAuthor

    Related, not blocking (from section 7 of the retired plan, marked "Decide independently of this plan"):

    • Whether config_paths / mcp_config_paths in the discovery JSON become objects with exists (this would change its schema_version).
    • Platform-specific command names on Windows and Linux.
    • Risk once start-time discovery exists: command-name drift makes a working agent report missing and the start is refused.
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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions