Skip to content

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

Closed

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
    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
    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. 152 remaining items

  6. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    Agent note — lane code-a, task 9174 (small_fix, code issue #5276)

    state: resumed / in-progress

  7. dezren39 commented on Nov 13, 2026

    @dezren39
    MemberAuthor

    Agent note — lane code-a, task 9174 (small_fix, code issue #5276)

    state: parked — CI wait on PR #9021

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

    @dezren39
    MemberAuthor

    agent-note:v1
    task: 9174
    lane: any-c
    state: done
    worker: repo-worker-code
    finding: PR #9021 MERGED 2026-11-13T09:40:50Z, merge commit f8bacfa, closing this issue. Resume verification this shift: head b022e30 MERGEABLE; all 15 Codex review threads carry substantive disposition replies — 14 fixed in named commits in this PR's chain, 1 deferred with reason to issue #9349 (local @Calls collection). Fresh targeted tests on the head: go test ./internal/execsvc (ok, 8.3s) and ./internal/daemon (ok, 92s) via fleet-build-lock on the laptop. The two red CI checks were proven not to be this PR: "production line limit" fails identically on current main fa5a286 (over-limit pkgs/id .rs files directory.rs 2559 / serve.rs 2784, guard script run locally against both trees), and "nix build" failed on Magic Nix Cache throttling (HTTP 418 substituter disabled). The mcpx-test suite checks were still queued in the fleet CI backlog at merge time; the relevant mcpx checks that did run (affected-embed, fix-carries-a-test, scripts, spec parity, mcpx-docs) passed.
    next: None for this slice — follow-up issue #9349 (local @Calls forwarding) is separate queued work. Task 9174 completes fixed_merged.

  11. removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 13, 2026
  12. added a commit that references this issue on Nov 17, 2026
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 requestepic/mcpx-platformReprioritization program epic (2026-11-12)kind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedmeta/follow-upFollow-up spun out of earlier workpriority/normalOrdinary priority (the default)source/queue-workerFiled or worked by the queue/worker pilottask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions