fix: tool-result message for non-vision tools (KeyError on width); polza provider verified end-to-end (vision + mission on first attempt)

This commit is contained in:
opencode
2026-08-08 20:18:43 +03:00
parent 54ee734ab5
commit c33452edf8
4 changed files with 164 additions and 1 deletions
+19
View File
@@ -64,6 +64,25 @@ taken); stop the old one with `fuser -k 8765/tcp` or Ctrl-C in its terminal.
The demo prints a full transcript of tool calls/results to stdout and saves the
capsule's final first-person frame to `demo_final_frame.png`.
## Providers
Provider presets resolve endpoint + API key + default model:
```bash
export POLZA_API_KEY="..." # from https://polza.ai/dashboard/api-keys
scripts/run_chat.sh --provider polza # openai/gpt-5.6-luna, vision ON
scripts/run_demo.sh --provider polza --agent llm
scripts/run_demo.sh --provider openai --model gpt-4o-mini
# local ollama stays the default (no flags needed)
# anything else OpenAI-compatible:
scripts/run_chat.sh --base-url https://... --model ... --api-key ...
```
Keys are read from the environment (`POLZA_API_KEY`, `OPENAI_API_KEY`), never
stored in the repo. Multimodal models (gpt-5.x, gemma, qwen-vl, ...) get real
camera frames automatically; `--vision`/`--no-vision` override.
## Interactive chat mode
Talk to the capsule's brain in natural language (any language):
+8 -1
View File
@@ -516,7 +516,7 @@ class LLMController:
)
self.messages.append(self._frame_message(frame_b64, frame_note))
self._trim_frames()
else:
elif frame_b64 is not None:
# Fallback channel: the digest (plus frame metadata) for
# text-only models.
content = (
@@ -528,6 +528,13 @@ class LLMController:
self.messages.append(
{"role": "tool", "tool_call_id": tc.id, "content": content}
)
else:
# Any other tool: plain structured result, prefixed with
# the CURRENT STATE note.
content = (hint + "\n" if hint else "") + json.dumps(outcome.output)
self.messages.append(
{"role": "tool", "tool_call_id": tc.id, "content": content}
)
call_result = ToolCallResult(
name=name, args=args, ok=True, output=outcome.output, digest=digest
)