Skip to content

bug(harnesscli): blocked-run hint suggests 'continue', which returns 409 for a run waiting on user input #1374

Description

@dennisonbertram

[parent] #1369

Work type

Bug / regression

Observed behavior

A headless harnesscli --prompt ... whose run calls AskUserQuestion exits 3 and prints:
harnesscli: run <id> blocked: waiting for user input (run.waiting_for_user); ... resume with: harnesscli continue <id> <prompt>.
Running that command returns harnesscli continue: status 409 (run_not_completed): run is not completed and the run stays waiting_for_user. The working call is POST /v1/runs/{id}/input {"answers": {...}}, which the CLI cannot issue.

Expected behavior

The blocked message names an action that works: either a CLI subcommand that submits answers (harnesscli input <run-id> "<question>=<answer>", mirroring the TUI) or, at minimum, the exact API call. harnesscli continue on a run that is waiting for input should explain that and point to the right command.

Reproduction

Fake provider turn = AskUserQuestion; harnesscli --prompt x </dev/null; follow the printed hint. Deterministic.

User and operational impact

Headless automation and users following the CLI's own instructions hit a dead end; the run stays blocked until the ask-user timeout (5 min default) fails it.

Suspected seam and search evidence

cmd/harnesscli/main.go reportRunBlocked; cmd/harnesscli/runctl.go runContinue posts /continue; internal/server/http_runs.go handlePostRunInput accepts answers. Related #823 (exit-code conventions) does not cover the hint.

Blast-radius impact map

CLI only; no server change unless continue on a waiting run should return a more specific error. Tests: cmd/harnesscli/*_test.go. Docs: harnesscli runbook.

Regression test first

cmd/harnesscli TestReportRunBlocked_WaitingForUserHintsInput and TestRunInput_PostsAnswers; red: go test ./cmd/harnesscli -run 'TestReportRunBlocked|TestRunInput'.

Fix boundaries

In scope: correct hints per blocked event type (approval → /approve|/deny or the TUI; question → new input subcommand); add the small input subcommand. Out of scope: interactive prompting in the headless path, exit-code redesign (#823).

Diagnostic and observability evidence

CLI stderr transcript above.

Verification plan

Red/green; live: blocked CLI run, run the printed command, run completes.

Rollout and rollback

CLI-only; revert PR.

Documentation and handoff

Engineering log; docs/runbooks/harnesscli-live-testing.md blocked-run section.

Definition of done

  • Hint names a working command; input subcommand tested
  • Live proof; regression green

Process acknowledgement

  • I will preserve the failing regression test, update the issue if the root cause changes, and record any newly discovered bug as its own issue.

Activity

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

    bugSomething isn't workinguxUser experience improvements

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions