Skip to content

bug(agents): start_agent drops skills_injection/skills_result at the API boundary — skill-delivery failures are invisible to REST and MCP callers #2991

Closed

Description

@vybe

Problem

start_agent injects assigned library skills and computes a full result — and then throws it away at the API boundary. A caller who starts an agent over REST or MCP cannot tell whether skill delivery succeeded, was skipped, or hit a conflict.

This violates the product quality bar's "tell the truth about state": the response says "Agent X started" while a skill the operator assigned may have silently failed to land.

Evidence (abilityai/trinity dev@6b0ddd96)

  • services/agent_service/lifecycle.py:483-484, 569-570 — start_agent_internal runs inject_assigned_skills() and returns both skills_injection (status) and skills_result (the detail, including per-skill delivery_status).

  • routers/agents.py:866-878 — the endpoint rebuilds the response from a fresh whitelist containing message, credentials_injection, credentials_result, recreated, recreate_reason, recreate_deferred. Neither skills field is in it. The code comment states the mechanism exactly:

    "This dict is a fresh whitelist, NOT start_agent_internal's return value, so a field added there does not reach the API unless it is also added here."

    The two credentials fields are whitelisted — so the omission is an oversight in the same shape, not a deliberate redaction.

  • MCP start_agent returns only message, so the loss compounds for any automated caller.

  • services/fleet_ops_service.py:375 already reads start_result.get("skills_injection") internally — the field is considered useful one layer down, and is dropped one layer up.

Why it matters now

Skill injection has several silent failure modes that only this field reports: a name collision with an agent-authored .claude/skills/<name>/ yields conflict with nothing written and force does not override; byte caps (10 MiB/skill, 50 MiB/run, 64 KiB frontmatter) drop a package; a plain restart skips injection entirely while a recreate re-injects (lifecycle.py:447,483). None of these reach a remote operator today. Any controller or fleet automation that starts an agent and assumes its assigned skills are present is assuming something the API declined to tell it.

Proposal

Add skills_injection and skills_result to the routers/agents.py response whitelist, alongside the credentials pair they mirror, and surface both in the MCP start_agent return.

Acceptance criteria

  1. POST /api/agents/{name}/start returns skills_injection and skills_result with the values start_agent_internal produced.
  2. MCP start_agent surfaces at minimum the status plus any per-skill non-delivered outcomes.
  3. A start where one skill hits conflict is distinguishable by the caller from a clean start, without a second call (quality bar fix: add missing logging_config.py to backend Dockerfile #4).
  4. An agent with no assigned skills returns the no-op status rather than an absent field — absence must not be how "nothing to do" is spelled (quality bar Fix: Add missing Docker labels to system agent container #1).
  5. No secret or source URL enters the payload — skills_result carries names and statuses only, consistent with the ent#334 projection rule.

Related

  • abilityai/trinity-enterprise#692 — admin/controller source management over MCP (same surface, remote-caller blindness).
  • Product read: reports/findings/2026-09-23-regent-product-read.md §4 (trinity-pm workspace) · intake OP-110.

Activity

  1. added
    priority-p2
    type-bug
    theme-reliability
    complexity-low
    on Sep 23, 2026
  2. dolho commented on Sep 24, 2026

    @dolho
    Contributor

    /claim

  3. added
    status-in-progress
    on Sep 24, 2026
  4. self-assigned this
    on Sep 24, 2026
  5. github-actions commented on Sep 24, 2026

    @github-actions

    Claimed by @dolho. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/2991-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #2991
  6. added
    status-in-dev
    and removed
    status-in-progress
    on Sep 25, 2026
  7. removed
    status-in-dev
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-lowpriority-p2theme-reliabilitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions