Skip to content

The handoff prompt a user answers is scraped from prose, because no structured field exists to prefer #621

Description

@serge-ivo

What was found

While closing #617, RuntimeTask.handoff_field was removed from the console's type because nothing on either side has ever emitted it. A repo-wide grep (excluding the generated workers/host/src/pages.ts bundle) returned exactly two hits, both in the console:

store/console/src/lib/types.ts:160     handoff_field?: string;
store/console/src/pages/RunDetail.tsx:405  const field = task?.handoff_field || detail.replace(...)... || "your answer";

RunnerTask (packages/browser-runner/src/types.ts:35-55) declares id, type, status, input, title, subtitle, description, output, error, requiresApproval, approval, createdAt, updatedAt, completedAt — no handoff keys — and mirrorRuntimeTask (workers/api/src/routes/instances-runtime.ts:240) stringifies the task whole, so the mirrored payload cannot contain a field the runner did not send.

Why it matters

That || chain is the label on the input box a user is asked to fill during an ask-and-hold handoff. Since the first operand can never win, the prompt has always been either:

  • a regex over the handoff message — detail.replace(/^Needs your input\s*[—-]\s*/i, "").split("(")[0].trim(), or
  • the literal words "your answer" when that yields nothing.

So the quality of the question depends on the phrasing of a message written for a human to read, and degrades silently to a placeholder. #617 removed the dead operand and left the scrape as the stated implementation, because inventing a producer was out of that issue's scope.

What this issue is for

Decide whether the handoff should carry a structured field:

  1. The workflow already KNOWS what it is asking for — request_user_info names the field before the pause. Emitting it onto the task (or the agent.needs_input event's data) is the natural fix.
  2. If it should NOT be structured, say so and delete the scrape's ambition: the label becomes "what the agent said it needs", not a field name.

Either way the current state — a fallback chain whose preferred branch is unreachable — should not survive, and #617 has already removed the misleading half.

Verified vs inferred

Files: store/console/src/pages/RunDetail.tsx, packages/browser-runner/src/types.ts, workers/api/src/lib/apply-loop.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2: correctnessReal defect, no live harm today — inert fields, miscounts, missing guardsbrowser-agentsBrowser automation generalizationenhancementNew feature or requestrunnerpackages/browser-runner + packages/cli — ships only via an npm publish

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions