A local-first multi-agent app development platform, built on PenguinHarness
A new Project's default model can read a picture (#534)
Yaowei Zheng16bd9e62f641
diff --git a/README.md b/README.mdindex 2bf9f917..26aee888 100644--- a/README.md+++ b/README.md@@ -210,7 +210,7 @@ cd penguin-installThe same engine, scriptable — made to be driven by agents (and agents building agents):```bash-penguin config model add --provider deepseek --model-id deepseek-v4-flash --api-key sk-... --set-default+penguin config model add --provider deepseek --model-id deepseek-v4-flash-vision-exp --api-key sk-... --set-defaultpenguin run -m "Create hello.txt containing Hello, Penguin" # one-shot taskpenguin chat # interactive REPL (/compact, /clear, /exit, Ctrl-C to interrupt)penguin server # headless service (same API the Web App uses)diff --git a/README.zh.md b/README.zh.mdindex 72ef761a..0c6f6e6e 100644--- a/README.zh.md+++ b/README.zh.md@@ -210,7 +210,7 @@ cd penguin-install同一引擎、可脚本化——为被 Agent 驱动而生(以及让 Agent 构建 Agent):```bash-penguin config model add --provider deepseek --model-id deepseek-v4-flash --api-key sk-... --set-default+penguin config model add --provider deepseek --model-id deepseek-v4-flash-vision-exp --api-key sk-... --set-defaultpenguin run -m "Create hello.txt containing Hello, Penguin" # 单次任务penguin chat # 交互式 REPL(/compact、/clear、/exit、Ctrl-C 中断)penguin server # 无界面服务(与 Web 应用同一套 API)diff --git a/changelog/unreleased/2026-08-28-default-vision-model.md b/changelog/unreleased/2026-08-28-default-vision-model.mdnew file mode 100644index 00000000..f6df7485--- /dev/null+++ b/changelog/unreleased/2026-08-28-default-vision-model.md@@ -0,0 +1,27 @@+# A new Project's default model can read a picture++- **Date:** 2026-08-28+- **Type:** feature+- **Scope:** `model-catalog`, `core`, `server`, `docs`, `skills`+- **PR:** [#534](https://github.com/Prism-Shadow/penguin-harness/pull/534)++[中文版](2026-08-28-default-vision-model.zh.md)++A new Project defaulted to `deepseek/deepseek-v4-flash`, which is text-only, and a fresh install+sets no `vision_model` either — so a pasted screenshot had no path to being read at all: it was+saved to the scratchpad and handed over as a file path, and the tool that would have described it+ended with "no vision model is configured". The default is now+`deepseek/deepseek-v4-flash-vision-exp`, which reads the image itself.++## Details++- **New Projects only.** A Project's default is copied in at creation and owned by it from then+ on; no write path rewrites an existing one, and "sync presets" never touches the stored+ default. An existing Project switches by picking the model, as it always could.+- The first-run command in the README and in the CLI and SDK quickstarts named the old id with+ `--set-default`, which would have pinned the text-only model back on a fresh install. All six+ lines now name the new default, and the `models` and `configuration` samples, the `vision =+ false` example beside them and the `penguin-sdk` Skill were updated with them.+- The core test now asserts the property rather than the id — that whatever the default names is+ a catalog entry with `supportsVision` — so a future change of default cannot quietly land back+ on a model that declines the first image it is shown.diff --git a/changelog/unreleased/2026-08-28-default-vision-model.zh.md b/changelog/unreleased/2026-08-28-default-vision-model.zh.mdnew file mode 100644index 00000000..e91b282d--- /dev/null+++ b/changelog/unreleased/2026-08-28-default-vision-model.zh.md@@ -0,0 +1,16 @@+# 新建 Project 的默认模型能看图了++- **Date:** 2026-08-28+- **Type:** feature+- **Scope:** `model-catalog`, `core`, `server`, `docs`, `skills`+- **PR:** [#534](https://github.com/Prism-Shadow/penguin-harness/pull/534)++[English](2026-08-28-default-vision-model.md)++新建 Project 的默认模型此前是 `deepseek/deepseek-v4-flash`,它只支持文本;而全新安装同样没有配置 `vision_model`,于是粘贴进来的截图根本没有可读的路径——它会被保存到 scratchpad 并以文件路径交出,而本该代读它的工具以「本 Project 未配置视觉模型」结束。默认模型现在改为 `deepseek/deepseek-v4-flash-vision-exp`,它自己就能读图。++## 细节++- **仅影响新建 Project。** Project 的默认模型在创建时被复制进去,此后归它自己所有;没有任何写入路径会改写既有配置,「同步预置」也从不触碰已存的默认模型。既有 Project 像以往一样,自己选一下即可切换。+- README 与 CLI、SDK 两份快速上手里的首次运行命令仍带着旧 id 与 `--set-default`,在全新安装上会把默认模型又钉回纯文本的那个。六处命令均已改为新的默认模型,`models` 与 `configuration` 中的示例、紧随其后的 `vision = false` 举例,以及 `penguin-sdk` Skill 一并更新。+- core 的测试现在断言的是**性质**而不是那个 id——无论默认模型指向谁,它在目录中的条目必须 `supportsVision`——这样以后再改默认模型,就不会悄悄退回到一个会拒绝它收到的第一张图片的模型上。diff --git a/packages/core/src/state/project-config.ts b/packages/core/src/state/project-config.tsindex c568e165..5821bb2f 100644--- a/packages/core/src/state/project-config.ts+++ b/packages/core/src/state/project-config.ts@@ -205,7 +205,13 @@ export interface ProjectConfig {*/export function defaultProjectConfig(): ProjectConfig {return {- default_model: { provider: "deepseek", model_id: "deepseek-v4-flash" },+ // The vision revision rather than the base model: it is the same context window at the+ // same published price, with image input on top — a strict superset, so defaulting to the+ // text-only sibling only meant a new Project could not read a pasted screenshot until+ // someone noticed why. A Project's default is copied in at creation and owned by it from+ // then on, so this reaches new Projects alone; an existing one keeps whatever it stored,+ // and "sync presets" never touches the stored default.+ default_model: { provider: "deepseek", model_id: "deepseek-v4-flash-vision-exp" },// The factory command-policy rules are seeded like the model presets: copied into the// new project's config and owned by it from then on — later factory changes never// rewrite an existing file. Spread to keep the module-level constant frozen.diff --git a/packages/core/test/agent.test.ts b/packages/core/test/agent.test.tsindex 9abed3e1..5d81f0d4 100644--- a/packages/core/test/agent.test.ts+++ b/packages/core/test/agent.test.ts@@ -179,9 +179,9 @@ describe("Agent.createSession model reference ((provider, model_id) pair)", () =// (same source that Trace writes).const meta = session.metaMessage.payload as { provider: string; model_id: string };expect(meta.provider).toBe("deepseek");- expect(meta.model_id).toBe("deepseek-v4-flash");+ expect(meta.model_id).toBe("deepseek-v4-flash-vision-exp");expect(session.provider).toBe("deepseek");- expect(session.modelId).toBe("deepseek-v4-flash");+ expect(session.modelId).toBe("deepseek-v4-flash-vision-exp");} finally {session.dispose();}@@ -239,7 +239,7 @@ describe("Agent.createSession model reference ((provider, model_id) pair)", () =const session = await agent.createSession({ workspaceDir: ws });try {expect(session.provider).toBe("deepseek");- expect(session.modelId).toBe("deepseek-v4-flash");+ expect(session.modelId).toBe("deepseek-v4-flash-vision-exp");} finally {session.dispose();}diff --git a/packages/core/test/state.test.ts b/packages/core/test/state.test.tsindex 6c73770a..4f797429 100644--- a/packages/core/test/state.test.ts+++ b/packages/core/test/state.test.ts@@ -1310,9 +1310,20 @@ describe("project-config round trip", () => {expect(entry?.vision).toBeUndefined();});- it("default config presets the full model catalog (default = deepseek deepseek-v4-flash)", () => {+ it("default config presets the full model catalog (default = deepseek deepseek-v4-flash-vision-exp)", () => {const cfg = defaultProjectConfig();- expect(cfg.default_model).toEqual({ provider: "deepseek", model_id: "deepseek-v4-flash" });+ expect(cfg.default_model).toEqual({+ provider: "deepseek",+ model_id: "deepseek-v4-flash-vision-exp",+ });+ // The default has to be a model that can actually read an image: a new Project's first+ // pasted screenshot goes to it, and the text-only sibling would decline one for a reason+ // nothing on screen explains.+ const chosen = MODEL_CATALOG.find(+ (m) =>+ m.provider === cfg.default_model!.provider && m.modelId === cfg.default_model!.model_id,+ );+ expect(chosen?.supportsVision).toBe(true);// The catalog is presented in full: provider and model_id are separate columns, model_id// being the plain upstream id (vision is only persisted as false for models that don't// support images).diff --git a/packages/docs/content/configuration.en.md b/packages/docs/content/configuration.en.mdindex 6c3c89de..2c84ebc3 100644--- a/packages/docs/content/configuration.en.md+++ b/packages/docs/content/configuration.en.md@@ -73,13 +73,13 @@ Model entry (`[[models]]`) fields:| `created_at` | Write timestamp of `api_key` (ISO 8601; a display field maintained by the interface layer) |```toml-default_model = { provider = "deepseek", model_id = "deepseek-v4-flash" }+default_model = { provider = "deepseek", model_id = "deepseek-v4-flash-vision-exp" }[[models]]provider = "deepseek"-model_id = "deepseek-v4-flash"+model_id = "deepseek-v4-flash-vision-exp"context_window = 1000000-vision = false+vision = trueapi_key = "sk-..."[models.pricing]diff --git a/packages/docs/content/configuration.zh.md b/packages/docs/content/configuration.zh.mdindex 4fe4200d..1485a0b9 100644--- a/packages/docs/content/configuration.zh.md+++ b/packages/docs/content/configuration.zh.md@@ -73,13 +73,13 @@ openrouter、fireworks、siliconflow、tokendance、qwen-pay-as-you-go、qwen-to| `created_at` | `api_key` 写入时间(ISO 8601,界面维护的展示字段) |```toml-default_model = { provider = "deepseek", model_id = "deepseek-v4-flash" }+default_model = { provider = "deepseek", model_id = "deepseek-v4-flash-vision-exp" }[[models]]provider = "deepseek"-model_id = "deepseek-v4-flash"+model_id = "deepseek-v4-flash-vision-exp"context_window = 1000000-vision = false+vision = trueapi_key = "sk-..."[models.pricing]diff --git a/packages/docs/content/models.en.md b/packages/docs/content/models.en.mdindex 2a82eb8b..a6a7c10d 100644--- a/packages/docs/content/models.en.md+++ b/packages/docs/content/models.en.md@@ -30,17 +30,17 @@ Each Project's available models are recorded in the hidden `.project_config.toml| `pricing` | Three price buckets (unit `usd_per_mtok`, USD per million tokens): `cache_read` / `cache_write` / `output` || `api_key` / `base_url` | Inlined credentials, both optional; when blank, AgentHub falls back to environment variables |-A fresh Project defaults to deepseek-v4-flash. A `vision_model` entry can additionally designate the proxy model that `describe_image` uses for text-only session models (see [Tools & Approval](/tools)); it is unset by default.+A fresh Project defaults to deepseek-v4-flash-vision-exp, which reads images itself. A `vision_model` entry can additionally designate the proxy model that `describe_image` uses for text-only session models (see [Tools & Approval](/tools)); it is unset by default.File shape (illustrative):```toml-default_model = { provider = "deepseek", model_id = "deepseek-v4-flash" }+default_model = { provider = "deepseek", model_id = "deepseek-v4-flash-vision-exp" }vision_model = { provider = "google", model_id = "gemini-3.1-pro-preview" }[[models]]provider = "deepseek"-model_id = "deepseek-v4-flash"+model_id = "deepseek-v4-flash-vision-exp"context_window = 1000000[[models]]@@ -51,7 +51,7 @@ base_url = "https://llm.example.com/v1"api_key = "sk-..."```-For a model tagged `vision = false` (e.g. the DeepSeek series), images from conversation input are saved to the Session scratchpad and handed over as a file path spliced into the text, and the image-reading tool switches to `describe_image`.+For a model tagged `vision = false` (e.g. `deepseek-v4-flash`, the text-only sibling of the default), images from conversation input are saved to the Session scratchpad and handed over as a file path spliced into the text, and the image-reading tool switches to `describe_image`.## Built-in provider groupsdiff --git a/packages/docs/content/models.zh.md b/packages/docs/content/models.zh.mdindex d3d23fec..dae98d6b 100644--- a/packages/docs/content/models.zh.md+++ b/packages/docs/content/models.zh.md@@ -30,17 +30,17 @@ description: 经 AgentHub 单一网关接入模型,以 (provider, model_id)| `pricing` | 三档价格(单位 `usd_per_mtok`,USD 每百万 Token):`cache_read` / `cache_write` / `output` || `api_key` / `base_url` | 内联凭证,可留空;留空时 AgentHub 回退读环境变量 |-新建 Project 的默认模型是 deepseek-v4-flash。另可配置一条 `vision_model`,作为 text-only 模型使用 `describe_image` 时的代读模型(见 [工具与审批](/tools));默认不配置。+新建 Project 的默认模型是 deepseek-v4-flash-vision-exp,它自己就能读图。另可配置一条 `vision_model`,作为 text-only 模型使用 `describe_image` 时的代读模型(见 [工具与审批](/tools));默认不配置。文件形态(示意):```toml-default_model = { provider = "deepseek", model_id = "deepseek-v4-flash" }+default_model = { provider = "deepseek", model_id = "deepseek-v4-flash-vision-exp" }vision_model = { provider = "google", model_id = "gemini-3.1-pro-preview" }[[models]]provider = "deepseek"-model_id = "deepseek-v4-flash"+model_id = "deepseek-v4-flash-vision-exp"context_window = 1000000[[models]]@@ -51,7 +51,7 @@ base_url = "https://llm.example.com/v1"api_key = "sk-..."```-对标注 `vision = false` 的模型(如 DeepSeek 系列):对话输入中的图片会保存到 Session scratchpad,以文件路径形式拼入文本;读图工具切换为 `describe_image`。+对标注 `vision = false` 的模型(如 `deepseek-v4-flash`,即默认模型的纯文本同族):对话输入中的图片会保存到 Session scratchpad,以文件路径形式拼入文本;读图工具切换为 `describe_image`。## 内置 Provider 分组diff --git a/packages/docs/content/quickstart-cli.en.md b/packages/docs/content/quickstart-cli.en.mdindex 76f36e48..3aefcd44 100644--- a/packages/docs/content/quickstart-cli.en.md+++ b/packages/docs/content/quickstart-cli.en.md@@ -34,7 +34,7 @@ Offline installs, installing from source, install locations, version pinning andUse the Models page in the Web UI, or the CLI:```bash-penguin config model add --provider deepseek --model-id deepseek-v4-flash --api-key sk-... --set-default+penguin config model add --provider deepseek --model-id deepseek-v4-flash-vision-exp --api-key sk-... --set-default```- A model is always referenced as a `(provider, model_id)` pair, so `--provider` and `--model-id` are both required — the Provider is never inferred from the model id. See [Models & Providers](/models) for the built-in groups.diff --git a/packages/docs/content/quickstart-cli.zh.md b/packages/docs/content/quickstart-cli.zh.mdindex 16323097..fb0cb117 100644--- a/packages/docs/content/quickstart-cli.zh.md+++ b/packages/docs/content/quickstart-cli.zh.md@@ -34,7 +34,7 @@ penguin -v可以在 Web UI 的模型页完成,也可以用 CLI:```bash-penguin config model add --provider deepseek --model-id deepseek-v4-flash --api-key sk-... --set-default+penguin config model add --provider deepseek --model-id deepseek-v4-flash-vision-exp --api-key sk-... --set-default```- 模型引用始终是 `(provider, model_id)` 二元组,因此 `--provider` 与 `--model-id` 均为必填——Provider 绝不由模型 id 推断。内置分组见[模型与 Provider](/models)。diff --git a/packages/docs/content/quickstart-sdk.en.md b/packages/docs/content/quickstart-sdk.en.mdindex 4e5bf50a..9d1c6b79 100644--- a/packages/docs/content/quickstart-sdk.en.md+++ b/packages/docs/content/quickstart-sdk.en.md@@ -21,7 +21,7 @@ If this machine has no model configured yet, the shortest path is to install the```bashnpm install -g @prismshadow/penguin-cli-penguin config model add --provider deepseek --model-id deepseek-v4-flash --api-key sk-... --set-default+penguin config model add --provider deepseek --model-id deepseek-v4-flash-vision-exp --api-key sk-... --set-default```You can also keep credentials off disk entirely: when a model entry has no inline api_key, AgentHub (the LLM gateway library) reads environment variables such as `DEEPSEEK_API_KEY`, `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, and `GEMINI_API_KEY`. A `.env` file in the working directory is loaded automatically.diff --git a/packages/docs/content/quickstart-sdk.zh.md b/packages/docs/content/quickstart-sdk.zh.mdindex 6c0dffa8..a5a87144 100644--- a/packages/docs/content/quickstart-sdk.zh.md+++ b/packages/docs/content/quickstart-sdk.zh.md@@ -21,7 +21,7 @@ SDK 与其他两条路线读同一个数据目录 `~/.penguin/data`,所以在[```bashnpm install -g @prismshadow/penguin-cli-penguin config model add --provider deepseek --model-id deepseek-v4-flash --api-key sk-... --set-default+penguin config model add --provider deepseek --model-id deepseek-v4-flash-vision-exp --api-key sk-... --set-default```也可以完全不落盘:模型条目没有内联 api_key 时,LLM 网关库 AgentHub 会读取 `DEEPSEEK_API_KEY`、`ANTHROPIC_API_KEY`、`OPENAI_API_KEY`、`GEMINI_API_KEY` 等环境变量;工作目录下的 `.env` 会被自动加载。diff --git a/packages/server/test/auth.test.ts b/packages/server/test/auth.test.tsindex b33555e5..a8650a52 100644--- a/packages/server/test/auth.test.ts+++ b/packages/server/test/auth.test.ts@@ -93,7 +93,7 @@ describe("auth", () => {);expect(toml).toContain('name = "bob"');expect(toml).toContain(- 'default_model = { provider = "deepseek", model_id = "deepseek-v4-flash" }',+ 'default_model = { provider = "deepseek", model_id = "deepseek-v4-flash-vision-exp" }',);});diff --git a/packages/server/test/models.test.ts b/packages/server/test/models.test.tsindex 47fb5d99..3fe89963 100644--- a/packages/server/test/models.test.ts+++ b/packages/server/test/models.test.ts@@ -97,7 +97,10 @@ describe("models preset & catalog enrichment", () => {const res = await api.get(url());expect(res.status).toBe(200);const body = (await res.json()) as ModelsResponse;- expect(body.defaultModel).toEqual({ provider: "deepseek", modelId: "deepseek-v4-flash" });+ expect(body.defaultModel).toEqual({+ provider: "deepseek",+ modelId: "deepseek-v4-flash-vision-exp",+ });expect(body.models.map(pairKey)).toEqual(catalogPairs);const sonnet = pick(body, "anthropic", "claude-sonnet-4-6");@@ -115,7 +118,7 @@ describe("models preset & catalog enrichment", () => {const deepseek = pick(body, "deepseek", "deepseek-v4-pro");expect(deepseek.vision).toBe(false);expect(deepseek.envKey).toBe("DEEPSEEK_API_KEY");- expect(pick(body, "deepseek", "deepseek-v4-flash").isDefault).toBe(true);+ expect(pick(body, "deepseek", "deepseek-v4-flash-vision-exp").isDefault).toBe(true);// OpenRouter gateway model: the upstream id contains `/`, but under column storage it's just a// plain string; openai-chat protocol + a preset base URL inlined on the entry (no secret).@@ -417,7 +420,10 @@ describe("default_project presets", () => {const res = await api.get("/api/projects/default_project/models");expect(res.status).toBe(200);const body = (await res.json()) as ModelsResponse;- expect(body.defaultModel).toEqual({ provider: "deepseek", modelId: "deepseek-v4-flash" });+ expect(body.defaultModel).toEqual({+ provider: "deepseek",+ modelId: "deepseek-v4-flash-vision-exp",+ });expect(body.models.map(pairKey)).toEqual(catalogPairs);// The point of presets is "works out of the box": creating a Session should succeed without passing a model ref.@@ -428,7 +434,7 @@ describe("default_project presets", () => {expect(created.status).toBe(201);const { session } = (await created.json()) as SessionCreateResponse;expect(session.provider).toBe("deepseek");- expect(session.modelId).toBe("deepseek-v4-flash");+ expect(session.modelId).toBe("deepseek-v4-flash-vision-exp");});it("a default_project that already has models configured is left untouched (existing CLI config is not overwritten)", async () => {diff --git a/packages/skills/skills/penguin-sdk/SKILL.md b/packages/skills/skills/penguin-sdk/SKILL.mdindex 14901a12..483b5dc7 100644--- a/packages/skills/skills/penguin-sdk/SKILL.md+++ b/packages/skills/skills/penguin-sdk/SKILL.md@@ -3,8 +3,8 @@ name: penguin-sdkdescription: Use whenever the user wants to build an agent application — their own program with an embedded agent, such as an AI app, an agentic app or a RAG app. This is writing application code on the Penguin Harness SDK, not configuring an Agent State inside PenguinHarness. Covers self-contained projects, the createSession/run streaming loop with thinking and image messages, wiring the user's existing tools in as CLI commands, and a complete RAG recipe that ingests documents into a knowledge base and answers with citations behind a web UI.short_description: Build agent, AI and RAG applications on the Penguin Harness SDK.short_description_zh: 基于 Penguin SDK 构建智能体应用、AI 与 RAG 应用。-version: 22-updated: 2026-08-23T15:42:44Z+version: 23+updated: 2026-08-28T00:00:00Z---# Penguin Harness SDK@@ -56,7 +56,7 @@ If the package is not on your npm registry (it is developed in the PenguinHarnesConfigure a model for the app's data root, in this order — stop at the first that works:1. `penguin config model add --root <data_dir> --provider <group> --model-id <id> --api-key <key> [--base-url <url>] [--client-type openai-chat] --set-default` — prefer `--client-type openai-chat --base-url <endpoint>` (works with any OpenAI Chat Completions compatible endpoint; exact ids in the agenthub-models skill). `--provider` is required: a model is always the `(provider, model_id)` pair and the group is never inferred from the id (`custom` for an endpoint outside the built-in groups).-2. Environment variables cover the **credential only** (`DEEPSEEK_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, …) — model selection still comes from the project config, whose preset default is `deepseek-v4-flash`. Env-only setup therefore works out of the box only with `DEEPSEEK_API_KEY`; for another vendor either run the CLI command above or pass a configured `{ provider, modelId }` pair to `createSession`.+2. Environment variables cover the **credential only** (`DEEPSEEK_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, …) — model selection still comes from the project config, whose preset default is `deepseek-v4-flash-vision-exp`. Env-only setup therefore works out of the box only with `DEEPSEEK_API_KEY`; for another vendor either run the CLI command above or pass a configured `{ provider, modelId }` pair to `createSession`.Keep model API keys **project-local**: configure them with the penguin CLI into the app's own data root under the working directory, so the project stays self-contained and movable. When building an AI app, **always pass `--root <data_dir>` pointing at the app's data directory inside the current working directory** (the same path you give `createAgent({ root })`, e.g. `./penguin_data`) — never run `penguin config ...` without `--root`, or it writes to the global `~/.penguin/data` instead of the project. Never read, copy or fall back to model keys stored in the user's global `~/.penguin` directory — that config belongs to the person running Penguin, not to the app you are building.