Skip to content

fix(cli): advertise-required flags are enforced at invocation, breaking the legacy --provider path #2193

Description

@devRickyyy

Summary

advertise-required marks a flag as required in a command's advertised
schema while the daemon input binder still treats it as optional
(framework.Schema adds AdvertisedRequired fields to required, but
BindInput only enforces Required). Since #2004 added
validateCapabilityInput to Registry.Invoke, that advertisement is enforced
before binding, so invocations the handler explicitly supports are now
rejected outright.

Impact

Three commands carry advertise-required:"true" on agent-id:

  • services/tuttid/service/cli/providers/agentcontext/session_commands.go (agent start)
  • services/tuttid/service/cli/providers/agentcontext/skill_bundle.go
  • services/tuttid/service/cli/providers/agentcontext/composer_options.go

All three resolve the target through resolveAgentSelector
(legacy_compat.go:220), which requires exactly one of --agent-id or the
deprecated --provider and errors when both are set. provider is
hidden:"true", so it is absent from the advertised schema, while agent-id
is listed as required:

start schema required: ["agent-id","prompt"]   // provider not advertised at all

So the supported legacy invocation (--provider <name> without --agent-id)
is now rejected with input.agent-id is required before the handler runs, and
satisfying the validator by also passing --agent-id trips the
"provide exactly one" guard. There is no working spelling left for that path.

Secondary effect on the same code path: for genuinely required fields the new
validator's input.<name> is required replaces the binder's
missingRequiredError, dropping the hint tags written for Agents
(e.g. "Use agent list --json to discover available agents.").

Suggested direction

Validate against what the binder actually enforces rather than what the schema
advertises — e.g. exclude AdvertisedRequired-only fields from the schema's
required list used at invocation time, or skip the pre-binding required check
for builtin provider commands whose binder already owns required/enum/min/max
with better wording. Keep the connector trust boundary strict either way.

Provenance

Found while root-causing the CLI integer-flag break from the same commit
(cf33c5f48, #2004); that half is fixed in #2192. Deliberately left out of
that PR to keep the hotfix to the paths that were actually failing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:P1High priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions