Skip to content

refactor: scope harness configuration by target - #294

Merged
qiankunli merged 1 commit into
mainfrom
worktree-harness-config
Aug 14, 2026
Merged

refactor: scope harness configuration by target#294
qiankunli merged 1 commit into
mainfrom
worktree-harness-config

Conversation

@qiankunli

Copy link
Copy Markdown
Collaborator

Move Harness-specific launch settings under HarnessTarget entries and let each
Harness validate its own fields. Add configured Target selection to the CLI and
TUI, including /target for multiple instances of the same Harness.

The old flat Harness fields are intentionally unsupported.

Move Harness-specific launch settings under HarnessTarget entries and let each
Harness validate its own fields. Add configured Target selection to the CLI and
TUI, including /target for multiple instances of the same Harness.

The old flat Harness fields are intentionally unsupported.
@qiankunli
qiankunli merged commit ec0e93a into main Aug 14, 2026
Comment thread src/config/config.ts
const base = DEFAULT_CONFIG.targets[targetId];
const supplied = record(configured[targetId]);
const candidate = { ...(base ?? {}), ...(supplied ?? {}) };
if (typeof candidate.harness !== "string" || !candidate.harness.trim()) continue;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 devloop code-review · seed-2.1-pro

The loadTargets function silently drops misconfigured targets with no feedback to the user. Two cases are affected:

  1. Invalid target ID (line 60): If a target ID doesn't match /^[A-Za-z0-9][A-Za-z0-9._-]*$/, the entire entry is skipped with continue. For example, a target named my codex (with a space) would be silently ignored.

  2. Missing harness field (line 64): If the merged config has no valid harness string, the entry is skipped. A user who configures targets: { my-codex: { command: ["codex", "app-server"] } } (forgetting harness: "codex") gets no indication their target was dropped.

Since the config module has no logging mechanism (console.warn/console.error are not used anywhere in this file or the config directory), user-facing misconfiguration goes entirely unnoticed. The user's only symptom would be that their target doesn't appear in CLI/TUI selection, with no explanation.

ccr:fp=707cede1efb7

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccr:label=minor — 属实:src/config/config.ts:60/64 会丢弃非法 Target id 或缺失 harness 的自定义 Target,调用方只收到缩减后的 targets,CLI/TUI 无法解释该 Target 为何消失;合法配置执行不受影响,属于配置可诊断性问题。

@qiankunli

Copy link
Copy Markdown
Collaborator Author

🤖 devloop code-review · origin/main..HEAD · 92e1ce98f · models: deepseek-v4-pro×53, seed-2.1-pro×52, seed-2.1-turbo×56 · cost: 619s · ccr v1.13.49

1 finding(s)(1 条已作为独立 review thread 发布)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants