Skip to content

WIP: feat(ai-native): harden ACP task startup and error recovery - #4769

Open
lulusir wants to merge 6 commits into
mainfrom
codex/improve-acp-error-message
Open

WIP: feat(ai-native): harden ACP task startup and error recovery#4769
lulusir wants to merge 6 commits into
mainfrom
codex/improve-acp-error-message

Conversation

@lulusir

@lulusir lulusir commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Types

  • 🎉 New Features
  • 🐛 Bug Fixes
  • 📚 Documentation Changes
  • ⏱ Tests

Background or solution

Agentic task startup previously had several lifecycle and usability gaps around ACP process capacity:

  • background warmup could race with foreground task launches
  • failed or cancelled launches could leave temporary sessions or consume capacity
  • capacity exhaustion and slow startup lacked clear recovery behavior
  • generic OpenCode service and model errors were not actionable
  • Agent Task project and status guidance contained hard-coded English text

This PR introduces bounded ACP standby capacity managed by the Node-side process pool. It keeps at most one compatible standby process within the configured limit while always prioritizing foreground task launches. Failed or cancelled launches release temporary resources and preserve the task draft and unsent prompt for retry.

It also improves ACP error normalization by:

  • converting OpenCode service failures into retry and new-session guidance
  • displaying only bounded service diagnostics
  • identifying unavailable models and suggesting that the user select another model
  • retaining the original message, error code, metadata, and cause for diagnostics

Agent Task project management, task statuses, dialogs, tooltips, accessibility labels, and recovery messages are now localized in English and Chinese.

Unit, BDD, mock-agent, and Playwright coverage has been added for capacity handling, cancellation, cleanup, error guidance, and recovery.

Verification performed:

  • node --check test/bdd/fixtures/acp-agent/mock-acp-agent.mjs
  • yarn workspace @opensumi/playwright build
  • Prettier and ESLint through lint-staged
  • git diff --check

Full browser E2E execution was not run.

Changelog

  • Added bounded ACP standby process management for faster Agent Task startup.
  • Improved cleanup and draft recovery when task startup fails or is cancelled.
  • Added actionable guidance for OpenCode service failures and unavailable models.
  • Added English and Chinese localization for Agent Task project and status guidance.
  • Expanded automated coverage for ACP capacity, error, and recovery behavior.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.26923% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.52%. Comparing base (9fee6aa) to head (33de719).

Files with missing lines Patch % Lines
...ckages/ai-native/src/node/acp/acp-agent.service.ts 91.20% 19 Missing ⚠️
...tive/src/browser/chat/chat.internal.service.acp.ts 87.82% 11 Missing and 3 partials ⚠️
packages/ai-native/src/node/acp/acp-thread.ts 80.00% 9 Missing and 3 partials ⚠️
...ative/src/browser/chat/chat-manager.service.acp.ts 61.53% 4 Missing and 1 partial ⚠️
...i-native/src/browser/chat/acp-chat-queued-turns.ts 93.33% 4 Missing ⚠️
...ai-native/src/browser/chat/chat-manager.service.ts 25.00% 1 Missing and 2 partials ⚠️
...ges/ai-native/src/node/acp/acp-cli-back.service.ts 75.00% 2 Missing and 1 partial ⚠️
...i-native/src/browser/chat/chat.internal.service.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4769      +/-   ##
==========================================
+ Coverage   55.40%   55.52%   +0.12%     
==========================================
  Files        1762     1762              
  Lines      114271   114704     +433     
  Branches    25547    25688     +141     
==========================================
+ Hits        63313    63693     +380     
- Misses      42216    42258      +42     
- Partials     8742     8753      +11     
Flag Coverage Δ
jsdom 48.61% <34.42%> (-0.06%) ⬇️
node 13.97% <53.84%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lulusir lulusir changed the title WIP: Codex/improve acp error message WIP: feat(ai-native): harden ACP task startup and error recovery Jul 29, 2026
@opensumi opensumi Bot added 🎨 feature feature required 🐞 bug Something isn't working labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working 🎨 feature feature required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant