Skip to content

Implement prompt-action advise hooks for mcpx exec (#1929 Approach C, first slice) #5276

Open

Description

@dezren39

Parent: #1929 (Approach C — prompt hooks with declared effects).

Scope

Add the first safe prompt-action slice to the existing on: script exec hook list. A hook may be either the already-supported deterministic script action or a prompt action with declared effect: advise (default advise). Resolve through the configured internal/model.Provider layer (provider-keyed configuration/profiles are already on main); keep the current no-provider behavior deterministic: emit a warning/advice-unavailable hook frame and continue the script unchanged.

Prompt context/template values follow docs/decisions/0001-hook-vocabulary.md: user placeholders and built-ins such as @result, @error, @diagnostic, @calls, @artifacts, and @source are JSON-encoded/delimited as data, never raw text substitution. Keep the hook frame before the final result/error frame, report action/effect/model/duration, and attach advice without changing the run outcome. Preserve existing deterministic hooks and config-before-per-call declaration order.

Acceptance

  • Prompt and script actions share the current script-hook list; invalid/unsupported action/effect combinations fail validation rather than silently doing nothing.
  • advise prompt output is surfaced in the hook frame and does not transform the result or error.
  • Configured model and per-hook model selection use the provider layer; unavailable/provider-error paths warn and continue the deterministic run.
  • Regression tests cover success/error phases, built-in and user placeholder data delimiting, advice frame placement, provider unavailable/error fallback, and unchanged script hooks.
  • Targeted Go tests pass; CI review confirms the change against current main.

Explicitly deferred

Effects ask, propose, apply, and run (including elicitation, replacing outcomes, or executing generated code); prompt actions on non-script hook points; any opencode plugin-provider backend work. Those remain with #1929 / their owning work.

Design references

pkgs/mcpx/docs/decisions/0001-hook-vocabulary.md (accepted action/phase/template/frame contract) and 0002-autonomy-dial.md (accepted effect/autonomy vocabulary and ceilings). The provider layer and provider profiles are merged in #2592/#4836; sampling.answerLocally is merged in #4947. The deterministic hook foundation is PR #2616.

Activity

  1. added
    enhancementNew feature or request
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/queue-workerFiled or worked by the queue/worker pilot
    queue/queuedHas a queued task in the Supabase agent queue
    meta/follow-upFollow-up spun out of earlier work
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    status/readyTriaged and ready for queued implementation work
    on Nov 4, 2026
  2. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    task: 9174
    queue: repo-health-code-pilot
    worker: repo-worker-code
    lane: openchamber-scheduled-lane
    lane_id: c29174f1-48e0-4b13-b4ff-9b73ab67e9ab
    event: handed_off
    at: 2026-11-04T04:13:30Z

    Prompt-hook implementation handoff from triage task 8728 / parent #1929. Task 9174 is queued for the first bounded slice: prompt action on the script hook list with effect: advise, configured-provider integration, data-safe placeholders, hook frame integration, and deterministic fallback when provider is unavailable. Effects ask, propose, apply, and run plus non-script points remain deferred on #1929.

    Parent: #1929 · design contracts: pkgs/mcpx/docs/decisions/0001-hook-vocabulary.md and 0002-autonomy-dial.md.

  3. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    status/readyTriaged and ready for queued implementation work
    on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    task: 9174
    kind: small_fix
    state: picked_up -> handed_off (execution lane: opencode)
    lane: code-h (claiming), execution via opencode claimant
    next: opencode-claimant launches the bound session for task 9174; it drives the task to its terminal state under this queue's worker id.
    evidence: issue #5276 OPEN at handoff, no held/user-owned/do-not-* labels; labels set to queue/claimed + work/assigned + status/in-progress.

  5. 35 remaining items

  6. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 5, 2026
  7. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: parked
    task: 9174 (repo-health-code-pilot)
    worker: repo-worker-code
    lane_id: code-a
    execution_lane: opencode
    session_id: ses_e5e56398e3dffeg3FZ9gPF2KoK
    issue: #5276
    at: 2026-11-05T03:46:42Z

    Task 9174 is parked before implementation because the required laptop execution path is unavailable: the laptop-agent client/token path is missing here, and the preserved SSH fallback requires an HTTPS_PROXY runtime environment that is not present. No code or worktree was changed. Resume when laptop access is restored; then create/resume the dedicated task worktree, implement, run targeted tests on the laptop, and open a PR.

  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 5, 2026
  9. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  10. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Bound and launched OpenCode session ses_e5e5610f85cffekhsW7JTdi848 for queue task 9174 (issue #5276). The task was already claimed and handed off by repo-worker-code.

  11. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  12. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 5, 2026
  13. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · blocked

    • Agent: repo queue worker, execution lane opencode (repo-worker-code)
    • Session / ID: ses_e5e5610f85cffekhsW7JTdi848; task 9174
    • Found via: bound OpenCode session for task 9174.
    • Task: Blocked because implementation must run in a laptop worktree, but this session cannot reach the laptop. The client exists at /home/user/hatch/tools/laptop-agent.py, but HTTPS_PROXY is unset and the preserved SSH helper exits because its runtime proxy environment is missing. No branch or worktree was created.
    • Queue detail: the available repo-queue binary rejected the required --execution flag; the block action ran without session attribution and recorded placeholder blocker text. The actual access blocker is documented above; queue bookkeeping needs repair once a compatible CLI or worker lease is available.
    • Resume: restore laptop-agent proxy access, then requeue/resume task 9174.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workenhancementNew feature or requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedmeta/follow-upFollow-up spun out of earlier workpriority/normalOrdinary priority (the default)queue/blockedQueue or user escalation statesource/queue-workerFiled or worked by the queue/worker pilotstatus/blockedQueue or user escalation statetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testswork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions