Skip to content

uf-workflow and uf-finale tools expose empty parameter schemas to the model (parameters: vs SDK args: mismatch) #732

Closed

Description

@jflowers

Summary

Every tool factory in uf-workflow and uf-finale that declares
parameters passes them under a parameters: key using plain
{ type, description } objects. The tool() helper from
@opencode-ai/plugin 1.4.10 expects an args: key holding a zod
raw shape (z.ZodRawShape). Because neither the key nor the format
matches, the SDK ignores the declaration, args is left undefined,
and opencode exposes an empty JSON schema to the model — the
model never learns the parameters exist.

Root cause

node_modules/@opencode-ai/plugin/dist/tool.d.ts:40-43:

export declare function tool<Args extends z.ZodRawShape>(input: {
    description: string;
    args: Args;
    execute(args: z.infer<z.ZodObject<Args>>, context: ToolContext): Promise<ToolResult>;
})

vs .opencode/plugins/uf-workflow/index.ts:497-506 (git_push):

parameters: {
  setUpstream: { type: "boolean", description: "Set upstream tracking (--set-upstream origin <branch>)" },
  branch: { type: "string", description: "Branch name (required when setUpstream is true)" },
},

Wrong key (parameters vs args), wrong format (plain objects vs
zod schemas). Silently ignored — no type error, no runtime warning.

Affected tools (11 factories)

uf-workflow (.opencode/plugins/uf-workflow/index.ts):
checkpoint (line 234: command/step/data), get_progress (317),
clear_progress (355), normalize_model_name (413: rawModelId),
git_fetch (462: remote/branch), git_push (497:
setUpstream/branch), git_merge (558: ref), git_rebase (645: ref)

uf-finale (.opencode/plugins/uf-finale/index.ts):
uf_finale_commit_context (189: rawModelId), uf_finale_create_pr
(463: title/body/targetRepo), uf_finale_ci_poll (594: prNumber)

Control group: review-dispatch tools (use args: + zod, e.g.
index.ts:2513) and invoke-agent tools expose their full schemas to
the model at runtime.

Symptoms observed (two consecutive finales)

  • git_push called bare (schema shows no params) runs plain
    git push → "no upstream branch" failure → manual
    git push --set-upstream origin <branch> bash workarounds in the
    opsx/unleash-direct-review-dispatch and
    opsx/address-feedback-model-normalization finales
  • uf_finale_commit_context never receives rawModelId → commit
    attribution degrades to unknown-model ("Empty rawModelId
    provided")
  • normalize_model_name returns "Empty rawModelId provided"
  • uf_finale_create_pr (title/body/targetRepo) and
    uf_finale_ci_poll (prNumber) parameters undiscoverable

This directly undermines #709: the migrated
/uf.address-feedback command now instructs the agent to call
normalize_model_name, whose rawModelId parameter is hidden by
this same bug.

Why tests missed it

.opencode/test/uf-workflow.test.ts:869-881 invokes execute
directly with { setUpstream: true, branch: "feat/my-branch" } and
asserts the resulting git command. The tool object never passes
through the SDK's schema path, so parameter exposure is never
asserted. Unit tests stay green while the model-facing contract is
broken.

Proposed fix

  1. Rename parameters: → args: in all 11 factories.
  2. Convert plain { type, description } objects to zod shapes
    (z.string().describe(...), z.boolean(), z.number()).
  3. Add a schema-exposure regression test asserting each tool
    definition's args contains the expected keys.

Activity

  1. jflowers commented on Oct 15, 2026

    @jflowers
    ContributorAuthor

    Live confirmation from the PR #733 finale session: this is a hard
    break for model-side invocation
    , not just undiscoverability.

    Emitting an explicit prNumber parameter in the tool invocation
    (despite the empty schema) does not reach execute —
    uf_finale_ci_poll returns INVALID_PR_NUMBER both with and
    without the parameter present in the call. The parameter is either
    stripped by schema validation or forwarded untyped and rejected by
    the tool's runtime validation; in both cases it never arrives as a
    usable value.

    Consequences confirmed in this session:

    • uf_finale_ci_poll cannot be pointed at a PR by the model
    • uf_finale_create_pr cannot receive title/body — PR refactor(commands): resolve model attribution via normalize_model_name #733 was
      created via direct gh pr create with a temp body file instead
    • git_push cannot receive {setUpstream, branch} — bash fallback
      required (second consecutive finale)
    • uf_finale_commit_context cannot receive rawModelId — commit
      attribution degrades to unknown-model

    Unit tests stay green because they invoke execute directly with
    native JS types, bypassing the schema path entirely.

  2. self-assigned this
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions