opengap icon indicating copy to clipboard operation
opengap copied to clipboard

Feat/canonical model and tool formats

Open Nivesh353 opened this issue 5 months ago • 0 comments

Summary

Standardizes two declarative formats in the gitagent spec so exported agents work correctly on downstream runtimes (notably gitagent, which silently dropped tools/models in the old formats):

  1. Model field is now canonical provider:model (e.g. anthropic:claude-sonnet-4-6)
  2. Tool implementation now uses script: (with path: kept as a deprecated alias)

1. Canonical provider:model model format

model.preferred / model.fallback must now be provider:model — bare names (gpt-4o) are rejected. A shared parseModel() util (splits on the first colon) replaces the per-adapter provider-guessing logic.

  • New: src/utils/model.ts — parseModel(), KNOWN_PROVIDERS, isKnownProvider()
  • Schema: agent-yaml.schema.json enforces ^[a-z0-9-]+:.+$ on preferred/fallback
  • Validation: errors on bad format, warns on unknown provider
  • Adapters/runners reformat to each target's needs (bare for claude/openai/kiro; provider/model for opencode/github/nanobot/openclaw; {id, provider} for gemini; passthrough for gitclaw). Deleted the old inferProvider/mapModelName guessers.
  • import.ts now emits canonical provider:model
  • Migrated all example agent.yaml files + spec/docs examples

2. Tool implementation.script

type: script tools now use script: (the form gitagent's runtime reads). path: is still accepted but deprecated.

  • Schema: tool.schema.json adds script, deprecates path, requires one-of + runtime
  • Migrated example tools + spec doc

Breaking change

Agents with bare model names (gpt-4o) or no provider prefix will now fail validation. Migrate to provider:model (e.g. openai:gpt-4o). Tool path: remains valid but should migrate to script: for gitagent compatibility.

Nivesh353 avatar Jun 15 '26 08:06 Nivesh353