Skip to content

fix(agent): stabilize design execution - #202

Draft
d8dzmf5mfn wants to merge 3 commits into
ZSeven-W:mainfrom
d8dzmf5mfn:codex/fix-agent-stability
Draft

fix(agent): stabilize design execution#202
d8dzmf5mfn wants to merge 3 commits into
ZSeven-W:mainfrom
d8dzmf5mfn:codex/fix-agent-stability

Conversation

@d8dzmf5mfn

@d8dzmf5mfn d8dzmf5mfn commented Aug 7, 2026

Copy link
Copy Markdown

Summary

Stabilizes design execution across intent routing, the OpenCode completion bridge, background canvas updates, and terminal failure reporting. Non-requests no longer start a design run, incomplete or tool-using text completions fail safely, generated edits stay bound to the page where their run started, and failed sections now expose their exact diagnostic instead of a generic "Needs attention" state.

Changes

  • Route punctuation-only input and classifier failures to chat instead of starting an unrelated design run.
  • Disable OpenCode tools for text-only completions, abort escaped tool calls and timeouts, and reconcile streamed text with the persisted final response.
  • Bind remote design commands to the page where the turn started while preserving the page and selection currently visible to the user.
  • Preserve each failed subtask's concrete provider/orchestrator error through terminal summaries.
  • Identify summary-only failures by their human-readable section label.
  • Add explicit diagnostics for missing results, empty provider diagnostics, disconnected sessions, and user-stopped work.
  • Expand failed activity cards by default so the error is immediately visible; an explicit user collapse still wins.
  • Replace generic completion copy with text that points users to the expanded failed sections.
  • Add regression coverage for classifier failures, OpenCode protocol failures, page switching, terminal summaries, disconnects, partial summaries, localization, and failure-card expansion.

User impact

A failed section now reads as a location plus a cause, for example:

Customer Table — Reason: parent_id=dashboard was not found

Users no longer have to expand a collapsed row or infer the problem from "Needs attention".

Scope

The standalone retry-context change was removed from this PR because it overlaps with #180 by @adrotech. This PR does not resubmit that work.

Only Rust source and tests are included. No locally built app or release artifact is part of the PR.

Root Cause

The OpenCode adapter trusted partial SSE text while permitting coding tools, and background design commands targeted whichever page happened to be active when they arrived. Classifier failures also defaulted to a new design.

For diagnostics, live progress initially stored the concrete subtask error, but terminal summary handling overwrote it with a generic localized label. Failure cards also defaulted to collapsed after the activity stopped streaming, hiding any detail that survived.

These paths could produce truncated design output, mutate the wrong page, or leave users with no actionable explanation of where and why a section failed.

Related PRs

Type

  • feat — New feature
  • fix — Bug fix
  • refactor — Code refactoring (no behavior change)
  • perf — Performance improvement
  • docs — Documentation
  • test — Tests
  • chore — Build / tooling / dependencies

Validation

  • cargo test -p op-host-services chat_intent — 59 passed.
  • cargo test -p op-host-desktop — 412 passed, 5 ignored.
  • cargo test -p op-editor-ui --lib — 1,087 passed.
  • cargo test -p op-editor-core --lib — 861 passed.
  • cargo test -p op-i18n --lib — 10 passed.
  • Strict Clippy for the changed packages with dependencies excluded — passed after allowing the pre-existing Rust 1.96 unnecessary_min_or_max warning in an unchanged property-panel file.
  • rustfmt --edition 2021 --check <all changed Rust files> — passed.
  • git diff --check — passed.

The checkout is an intentionally nested Git worktree, so the repository-wide pre-commit cargo fmt --all command misidentifies an excluded vendored crate's outer workspace. The equivalent per-file Rustfmt check above passes. Full-workspace Clippy also reaches a pre-existing Rust 1.96 while_let_loop warning in op-figma, outside this patch.

Checklist

  • Relevant tests pass
  • Failure diagnostics identify the affected section and concrete reason
  • No local app or release artifact included
  • No unrelated changes included
  • Overlapping contributor work is excluded
  • Commit messages follow Conventional Commits

@d8dzmf5mfn d8dzmf5mfn changed the title fix(agent): stabilize design retries and execution fix(agent): stabilize design execution Aug 7, 2026
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