Skip to content

feat(6.30): API-parse-error callout + inline ⚠ + architect-always-unattended#37

Merged
fstamatelopoulos merged 4 commits intomainfrom
iteration-6/documenter-policy-warnings-6.30
May 9, 2026
Merged

feat(6.30): API-parse-error callout + inline ⚠ + architect-always-unattended#37
fstamatelopoulos merged 4 commits intomainfrom
iteration-6/documenter-policy-warnings-6.30

Conversation

@fstamatelopoulos
Copy link
Copy Markdown
Owner

Summary

Refines the policy/UX warnings around adapter choice for unattended roles. Driven by a re-test of the gemma4:31b documenter failure (item 6.30) which surfaced two findings:

  1. gemma4:31b is not the problem — the Anthropic-strict parser is. Same model, two routes: claude-code-ollama + gemma4:31b → fails with API Error: Content block not found. opencode-ollama + gemma4:31b → wrote all four documenter files cleanly. The OpenAI-compatible endpoint tolerates variance in tool-call output that Anthropic's parser rejects.
  2. The Solution Architect is unattended in the policy-relevant sense — even via cfcf review. Verified in code: ALL architect spawns (pre-loop autoReviewSpecs, mid-loop refine_plan, manual cfcf review) use spawnProcess with stdout: "pipe" + log file. There's no stdio: "inherit" anywhere in the architect path. The cfcf review CLI is just a polling client to a server-side background spawn. PA + HA are the only two roles that actually take over the user's shell.

What's new

  • New blue info callout: API parse errors with some ollama models on claude-code-ollama (May 2026) — fires when any unattended role uses claude-code-ollama. Recommends switching to opencode-ollama for the same model when the parse error bites.
  • Inline ⚠ glyph next to the adapter selector for any unattended row on claude-code (direct). Visual link between the row and the yellow policy callout below the table. Scoped to unattended roles only — PA and HA rows don't flag.
  • Architect always counted as unattended for these warnings. Drops the previous autoReviewSpecs=true qualifier on the architect role label across all surfaces (web Settings + workspace Config + cfcf init + cfcf doctor).
  • isApiParseRisk(adapter) helper in @cfcf/core, sister to existing isClaudeCodeHarnessRisk. Tests added.
  • Universal-scope wording: "Applies to any unattended role on claude-code-ollama (dev, judge, reflection, documenter, architect). PA and HA are unaffected — they run interactively in your terminal, so you see output live as the agent works." Plus "Currently configured for: …" replaces the previous "Affected roles: …" label so the dynamic list reads as your config rather than the definitive set.
  • Plain English instead of "TUI" jargon in user-facing callouts.

Behavior changes

  • Fresh cfcf init: architect role now defaults to a policy-clean adapter (codex or first available) instead of claude-code. Existing user configs are unaffected.
  • cfcf doctor: now flags architect as risky whenever its adapter is claude-code (previously only when autoReviewSpecs=true).

Docs

  • docs/guides/anthropic-policy.md updated: TL;DR, role-recommendations table, violation-pattern paragraph, "verify" instructions all now correctly classify architect as unattended.
  • docs/plan.md: 6.30 marked ✅ shipped with refined-finding summary; iter-6 active-set callout updated.

Test plan

  • bun run typecheck — clean
  • bun test — 774/774 pass
  • cd packages/web && bun run build — clean
  • Pre-existing app.test.ts config-merge failure on main verified unrelated (via git stash && bun test)
  • Manual: open web Settings + workspace Config, set claude-code-ollama on dev, confirm both blue callouts render with new wording on both views
  • Manual: set claude-code (direct) on architect, confirm inline ⚠ appears next to adapter selector and tooltip explains
  • Manual: cfcf init --force confirm new banner wording mirrors web

fstamatelopoulos and others added 4 commits May 8, 2026 16:24
…ttended

UI changes for the third-party-harness + ollama-adapter warnings, driven
by a refined understanding of the gemma4:31b failure mode (item 6.30).

**Refined finding from re-test (2026-05-08, post-v0.20.0)**: same
gemma4:31b model, two routes:
  - claude-code-ollama → fails with `API Error: Content block not found`
    (Anthropic-strict Messages API parser rejects the model's output)
  - opencode-ollama → wrote all four documenter files cleanly
The model IS capable; the strict-Anthropic-shape translation layer is
what rejects its output. Re-confirmed after the v0.20.0 process-tree
fix landed, so it's not a queue-starvation confound.

**What landed:**

- New `isApiParseRisk(adapter)` helper in `@cfcf/core`, sister to the
  existing `isClaudeCodeHarnessRisk`. 4 unit tests added.

- `HarnessPolicyWarning` (web Settings + workspace Config) now renders
  THREE callouts in order: yellow policy ⚠, blue API-parse-error ℹ
  (NEW), blue log-visibility ℹ. The new callout fires whenever any
  unattended role is on claude-code-ollama; recommends switching to
  opencode-ollama for the same model when the parse error bites.

- Inline ⚠ glyph next to the adapter selector for any unattended row
  on `claude-code` (direct). Visual link between the row and the
  yellow callout below the table. Scoped to unattended roles only —
  PA and HA rows don't flag (they're allowed-interactive scope).
  Hover-text explains it.

- `UNATTENDED_ROLE_NAMES` in @cfcf/core now always includes
  "architect". Previously the call sites (web + CLI) gated architect
  on `autoReviewSpecs=true`, but that was too narrow: the loop also
  invokes architect on `refine_plan` resume actions and judge
  NEEDS_REFINEMENT verdicts. The same adapter setting drives all
  three loop paths AND the manual `cfcf review` path, so the worst
  case (loop-invoked) is what we have to warn for. Test in
  `adapters.test.ts` updated.

- `cfcf init` banner mirrors the web changes: three notices in the
  same order; same role-always-architect handling.

- `docs/guides/anthropic-policy.md` documenter row updated with the
  refined finding: two workable paths (coder-tuned on claude-code-
  ollama, OR any model on opencode-ollama).

- `docs/plan.md` 6.30 marked ✅ shipped with full scope summary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Companion cleanup to ccd853e. After verifying that ALL architect
spawn paths are headless (`runReview` / `runReviewSync` →
`spawnProcess` with `stdout: "pipe"` + log file; `cfcf review` is
just a polling client to a server-side background spawn — there's
no `stdio: "inherit"` anywhere in the architect path), the
"manually-invoked SA is interactive" framing was wrong.

Surfaces fixed:

- `createDefaultConfig` (`packages/core/src/config.ts`): architect
  default flips from claude-code to a policy-clean adapter via
  `pickUnattendedDefault()` — same logic as dev/judge/documenter.
  Fresh installs no longer immediately fire the policy warning on
  the architect row. Comment updated with the correction. PA + HA
  remain claude-code-default (they ARE truly interactive — they use
  `Bun.spawn` with `stdio: "inherit"` so the agent's TUI takes over
  the user's shell). Test in `config.test.ts` updated to match.

- `cfcf doctor` `checkHarnessPolicy`: drops the
  `config.autoReviewSpecs &&` gate on the architect risk check and
  the "(autoReviewSpecs=true)" label suffix. Same reasoning: loop
  invokes architect unattended in three paths AND `cfcf review` is
  also unattended in the spawn-pattern sense.

- `docs/guides/anthropic-policy.md` TL;DR + violation-pattern
  enumeration + role-recommendations table + "verify" instructions:
  architect moved to the unattended bucket; "manually-invoked
  Solution Architect" no longer claimed as interactive scope. Adds
  an explicit note that the only `stdio: "inherit"` paths are PA
  (cfcf spec) and HA (cfcf help assistant).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…outs

The "Affected roles: dev, documenter, architect" line in the log-
visibility callout read as if judge + reflection were exempt — they
aren't. They'd buffer the same way if you set them to claude-code-ollama;
the line was just listing currently-configured roles on that adapter.

Wording fix in both blue info callouts (log-visibility + the new
API-parse-error from this branch):
  - Add an explicit "Applies to any unattended role on
    claude-code-ollama (dev / judge / reflection / documenter /
    architect). PA and HA are unaffected." line that states the
    universal scope upfront.
  - Rename "Affected role(s):" to "Currently configured for:" so the
    dynamic list reads as "your current config" rather than "the
    definitive set of affected roles".

CLI `cfcf init` banner mirrors the web wording (kept in sync per
docstring on HarnessPolicyWarning.tsx).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
"TUI" (Terminal User Interface) is fine in code comments and the
long-form anthropic-policy guide where the audience is technical, but
it's jargon for an inline warning a user reads while configuring a
workspace. Replaced in the two blue info callouts (web Settings +
workspace Config via shared HarnessPolicyWarning component) and in the
mirrored CLI `cfcf init` banner.

Old: "PA and HA are unaffected — their TUI takes over your shell."
New: "PA and HA are unaffected — they run interactively in your
      terminal, so you see output live as the agent works."

Code comments + design-doc TUI mentions left as-is — those audiences
expect the term.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fstamatelopoulos fstamatelopoulos merged commit 17b3baa into main May 9, 2026
2 checks passed
@fstamatelopoulos fstamatelopoulos deleted the iteration-6/documenter-policy-warnings-6.30 branch May 9, 2026 00:05
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.

1 participant