Repository navigation
fix(typesafe): send Ollama the instructions it requires - #13
Merged
Merged
Conversation
The decision contract makes question instructions optional, and the local
adapter sends them as null, which Kev accepts. Ollama's /v1/systemone rejects
missing or null instructions with HTTP 400, so an agent's decision_evaluate
call without instructions failed, and the 400 was reported as "transport"
("the selected provider could not be reached").
For a name-routed server (localModel set), fill omitted instructions with a
neutral per-type judgment the criteria already express. A local 400 now maps
to unsupported-input. Hosted Jev and Kev keep their behavior.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After #12 was deployed, the first real agent call to
decision_evaluateagainsttev1:4breturnedunavailable / transport("the selected provider could not be reached"). Ollama was reachable and healthy. The cause had two parts:instructionsoptional, and the local adapter sends a missing value asnull, which Kev accepts. Ollama's/v1/systemonerejects both a missing and anullvalue:400 question "b": instructions must be a nonempty string, object, or array. Agents usually leave instructions out when the criteria already express the judgment.transport, so the agent was told the server was unreachable instead of that its input was rejected.Solution
localModelis set, which means a name-routed server such as Ollama, omitted instructions are filled with a neutral judgment for each question type: choice "Select the option that best matches the state.", score "Select the level that best matches the state.", and noul "Decide whether the true description applies to the state." Supplied instructions are passed through unchanged. WithoutlocalModel(Kev),nullis still sent.baseUrl, HTTP 400 maps tounsupported-input. Hosted Jev error mapping is unchanged.Evidence
evaluate()against the realhttp://192.168.2.17:11434withtev1:4b, using the exact instruction-less question shape that failed in the agent run, now answers: choicegateway0.95, score 1.92/2, noul 0.92. Before the fix, the same request returned HTTP 400.unsupported-inputmapping (with hosted stayingtransport). Both fail without the fix and pass with it.extensions/typesafetotals 10 files and 171 tests passing. The new tests are fetch-stubbed and run in milliseconds.tsgo:extensionsandtsgo:extensions:testare clean, and so areoxlint,oxfmt --checkandgit diff --check.🤖 Generated with Claude Code