Skip to content

Fix Roc client wire semantics and execution safety #12466

Closed

Description

@dezren39

Context

Codex's review of the merged Roc Approach B implementation in PR #12465 identified behavior gaps in pkgs/mcpx/internal/codegen/roc.go and Roc runner dispatch. These are follow-up fixes; Approach C (a custom Roc platform) remains out of scope. Use Roc nightly 2026-11-13-03dce41 with basic-cli 0.28.1 as the compiler oracle.

Required fixes

  • Forward MCPX_RUN as X-Mcpx-Run so daemon dry-run interception is preserved; never allow a dry-run request to execute a real tool.
  • Forward MCPX_TRANSPORT_BEARER_TOKEN as Authorization: Bearer ... when configured.
  • Preserve original schema property names on the wire even when Roc identifiers are sanitized or collide.
  • Preserve omission of optional schema properties rather than serializing mandatory placeholders.
  • Encode {} for tools with no input properties.
  • Treat MCP tool envelopes with isError: true as a Roc Err, not a successful 2xx response.
  • Allow Roc compiler lookup to be resolved inside configured flake devshells, consistently with other runtimes.

Acceptance

  • Add regression tests for each listed behavior, including a mock-daemon dry-run proving the real tool handler is not called.
  • The generated client passes the specified Roc compiler oracle and focused go test -count=1 ./internal/api ./internal/codegen ./internal/runner in pkgs/mcpx.
  • Do not modify the merged Approach B implementation history or remove the preserved untracked task notes.
  • Approach C remains out of scope.

Activity

  1. developing-today commented on Nov 22, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked_up
    task: 21022
    issue: #12466
    lane: oc-code-06
    worker: repo-worker-code
    origin: openchamber-scheduled-lane
    stage: claimed -> verified

    Claimed and checkpointed. Fresh verification: #12466 is OPEN with no hard-stop labels or assignees; prerequisite PR #12465 is MERGED at 2a3979644bf6efee50d837e8ac06e44f71380016. The laptop primary clone is clean on main. I will inspect and preserve existing task notes/work before creating the task worktree; scope remains the listed Roc wire-safety/codegen/runner regressions, excluding Approach C.

  3. added a commit that references this issue on Nov 22, 2026
    92c6b57
  4. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Implementation is complete and pushed in PR #12475: #12475. Roc requests now include MCPX_RUN for fail-closed dry-run interception, and retain original JSON wire semantics, optional-field omission, bearer auth, and daemon/tool error propagation. Roc compiler lookup also works through flake devshells. Verified with go test -count=1 ./internal/api ./internal/codegen ./internal/runner and go test -race -shuffle=on -count=5 -run 'Roc' ./internal/codegen ./internal/runner from pkgs/mcpx using Roc nightly 2026-11-13-03dce41 and basic-cli 0.28.1.

  5. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked_up
    task: 21022
    issue: #12466
    lane: oc-code-06
    worker: repo-worker-code
    origin: openchamber-scheduled-lane
    stage: verified -> implementation_complete

    Reclaimed the expired task and resumed its existing PR #12475 (no competing branch). Fresh checks show the PR is open, unheld, and clean; prior acceptance tests are recorded in the PR. Codex has one unresolved P1 asking for property-based serialization coverage, so I am adding that test before considering merge.

  6. developing-today-fleet commented on Nov 22, 2026

    @developing-today-fleet
    Contributor

    agent-note:v1
    state: done
    task: 21022
    issue: #12466
    lane: oc-code-06
    worker: repo-worker-code
    origin: openchamber-scheduled-lane
    stage: merged

    Merged PR #12475 at 668d92d. Added seeded generated-schema and generated-argument property coverage against decoded mock-daemon requests; replied to Codex P1 at #12475 (comment). Focused runner and race/shuffle tests pass. The unrelated codegen compiler-oracle test fails on the host Roc nightly 2026-10-06 and reproduces on primary main; previous PR verification records the pinned 2026-11-13 oracle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions