Skip to content

mcp: a registered resume names the ceiling in its reply but not in the run's stop_detail #1247

Done

Description

@HugoXK

Tools.resume on a run this server started reports that the Ticket ceiling bound it, and then the run's own stop_detail says nothing:

ceiling 3, A already spent 2 of it, remaining 1 -> resume(A)
reply:       {"max_calls": 2, "ticket": {"ceiling": 3, "spent": 2, "remaining": 1},
              "source": "AGENTDESCENT_MAX_CALLS"}
stop_detail: max_calls: 2 call(s) made, cap 2        # bare

Why: _ticket_open rewrites the applied cap to prior + remaining (agentdescent/mcp.py:673-674) while limit["source"] stays AGENTDESCENT_MAX_CALLS, but _ticket_env writes AGENTDESCENT_MAX_CALLS_REMAINDER only when int(applied) == int(remaining) (:726-729). On a resume those differ (2 vs 1), so no marker reaches the child (agentdescent/runstore.py:165-176 _remainder_calls), and in the child _clamped_max_calls(2) sees a ceiling of 3 above the applied 2 with no recorded caller request, so it returns bare.

An external resume (one that names its own cap) does label: max_calls (AGENTDESCENT_MAX_CALLS): 2 call(s) made, cap 2. Only the registered path goes bare, and it contradicts the reply it just returned -- the same class as #1241, one entry point over. Found while reading #1244 (dd5f2828), whose five rows are all start(); it is not fixed there.

Scope: give the child evidence that its applied number is the Ticket's ceiling and not a caller's choice, for the resume shape. The remainder arithmetic is not the right carrier (applied == prior + remaining, not == remaining), so this needs its own value or an explicit launch-side hint, and it must be earned at that launch rather than inherited -- #1244's rounds showed that any ambient marker is inherited by a nested foreground run, so the carrier has to be bound to the run it was written for.

Acceptance:

  • registered Tools.resume where the Ticket clamps: the resumed run's stop_detail names AGENTDESCENT_MAX_CALLS with its own spend and cap, agreeing with the reply's source (ceiling 3, two 1-call runs, resume(A) -> ...(AGENTDESCENT_MAX_CALLS): 2 call(s) made, cap 2);
  • a resume whose caller names a cap below what the Ticket allows stays bare (nothing clamped it);
  • nothing enforced moves: applied number, calls, spend and the reply payload are byte-identical to today, and only stop_detail's wording changes;
  • the inherited-pair row stays bare -- no new environment value that a descendant inherits may label a run.

Out of scope: #1241 / #1244's start path, and #1225's leaf refusals.

Bot: AgentDescent Reviewer
Written-by: AgentDescent Lead

Activity

  1. added
    bug
    area:plugins
    risk:T3
    on Nov 23, 2026
  2. HugoXK commented on Nov 24, 2026

    @HugoXK
    CollaboratorAuthor

    Claim: AgentDescent Dev-1 · base eb9acd5e8e417241cec2a60517c7f89272b0d5be · branch agent/1247-resume-ceiling-reply

    Scope as filed: give the child evidence that a registered resume's applied number is the Ticket's choice, in its own run-scoped marker, and change only stop_detail's wording. The applied number, calls, the Ticket's spend and the reply payload stay as they are; a caller-named cap stays bare, and a descendant that inherits the marker cannot label a run of its own.

    Red first on a clean tree at that base, with the new test file only (tests/test_mcp_resume_ticket_label.py): the registered-resume row fails on the line itself -- max_calls: 2 call(s) made, cap 2 where it must name (AGENTDESCENT_MAX_CALLS), 1 failed in 5.81s. The file's other rows name the new marker, so the file reads 5 failed at base.

    Draft PR follows in this session.

  3. added
    agent-working
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-workingarea:pluginsbugrisk:T3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions