You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(models): expose a machine-readable routing contract #381
Expose the model-routing authority owned by gentle-pi through a stable, machine-readable process API so external ecosystem configurators can inspect and apply Pi per-agent model assignments without importing extension internals or editing Pi configuration directly.
The external consumer owns presentation. gentle-pi remains the authority for model discovery, agent discovery, validation, persistence, and apply semantics.
The two dedicated slices do not yet have approved numbered issues. Do not invent issue numbers or implement either slice until its own issue is created, approved, and kept within the review budget.
Issues #383 and #384 are status:needs-review holds. Their current bodies and approvals describe an obsolete three-PR chain and are not implementation contracts. No implementation may start from those stale bodies. #383 requires a completed and re-frozen #382 foundation. #384 additionally requires a re-frozen #383 inspection and validation contract.
All operations use a versioned contract such as gentle-pi.model-routing/v1.
The process contract must:
Accept explicit cwd, Pi agentDir, target scope, and contract version.
Emit exactly one JSON response on stdout and reserve stderr for diagnostics.
Return stable non-zero exit classes for invalid input, unsupported contracts, unavailable runtime capabilities, and persistence or apply failures.
Provide capability negotiation before a consumer depends on an operation.
Use Pi's supported SDK, including ModelRuntime, model resolvers, and DefaultResourceLoader when extension-registered providers are needed, rather than reproducing provider discovery.
Report configured models and the authenticated operational set when they differ.
Return canonical provider and model IDs and supported thinking levels, including model-specific mappings or clamps.
Return configurable agent names, current assignments, inherited or default state, target provenance, and diagnostics.
Validate drafts with the same rules used by /gentle:models.
Apply through the same canonical save and materialization path used by /gentle:models.
Replace saved configuration atomically. If downstream materialization can fail after the save, return an explicit partial outcome and exact affected targets rather than claiming success or silently rolling back.
Preserve unrelated configuration and unedited or unknown agent assignments according to canonical routing semantics.
Avoid network refresh by default. If refresh is supported, require explicit opt-in and a bounded timeout.
Process contract acceptance criteria
The installed npm package exposes a documented standalone model-routing command.
capabilities negotiates gentle-pi.model-routing/v1 and supported operations.
inspect works without opening the Pi TUI and returns current assignments, inherited state, configurable agents, available provider and model IDs, supported thinking levels, provenance, and diagnostics.
Custom configured providers are resolved through supported Pi SDK and resource-loading APIs rather than ad hoc provider JSON parsing.
validate rejects unknown contracts, malformed drafts, unavailable model IDs, and unsupported thinking levels without writing.
apply reuses the canonical Gentle Pi save and agent-routing materialization behavior.
Saved configuration is replaced atomically. Any later partial materialization is represented explicitly and never reported as full success.
Explicit project and global targeting and Pi config-root overrides are deterministic.
Unknown agents and unrelated configuration survive an inspect, edit, and apply round trip.
/gentle:models keeps its existing behavior and uses the same shared authority.
Model-routing contract roadmap
Requested outcome
Expose the model-routing authority owned by
gentle-pithrough a stable, machine-readable process API so external ecosystem configurators can inspect and apply Pi per-agent model assignments without importing extension internals or editing Pi configuration directly.The external consumer owns presentation.
gentle-piremains the authority for model discovery, agent discovery, validation, persistence, and apply semantics.This remains required by Gentleman-Programming/gentle-ai#3522, which owns the external Configure Pi Models experience.
Current delivery decision
The obsolete three-PR boundary is retired. Delivery is staged through the internal authority foundation before the external contract is re-frozen:
The two dedicated slices do not yet have approved numbered issues. Do not invent issue numbers or implement either slice until its own issue is created, approved, and kept within the review budget.
Issues #383 and #384 are
status:needs-reviewholds. Their current bodies and approvals describe an obsolete three-PR chain and are not implementation contracts. No implementation may start from those stale bodies. #383 requires a completed and re-frozen #382 foundation. #384 additionally requires a re-frozen #383 inspection and validation contract.Current status
main.Contract shape
Use a package-owned standalone command, tentatively:
All operations use a versioned contract such as
gentle-pi.model-routing/v1.The process contract must:
cwd, PiagentDir, target scope, and contract version.ModelRuntime, model resolvers, andDefaultResourceLoaderwhen extension-registered providers are needed, rather than reproducing provider discovery./gentle:models./gentle:models.Process contract acceptance criteria
capabilitiesnegotiatesgentle-pi.model-routing/v1and supported operations.inspectworks without opening the Pi TUI and returns current assignments, inherited state, configurable agents, available provider and model IDs, supported thinking levels, provenance, and diagnostics.validaterejects unknown contracts, malformed drafts, unavailable model IDs, and unsupported thinking levels without writing.applyreuses the canonical Gentle Pi save and agent-routing materialization behavior./gentle:modelskeeps its existing behavior and uses the same shared authority.Dependency diagram
Review budget and operating rules
size:exceptionis allowed for this chain. Split scope before approval if a child cannot fit.