目录
lujs

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

  • feat(ai-native): maintain bounded ACP standby capacity

  • fix(ai-native): improve ACP error guidance

  • feat(ai-native): localize Agent Task project guidance

  • test(ai-native): cover actionable ACP error guidance

  • fix(ai-native): stabilize ACP task lifecycle and e2e

  • feat(ai-native): optimize agentic task conversation switching

  • fix(ai-native): sync virtual list dependency lockfile

  • fix(ai-native): stabilize agentic virtual list e2e assertions

  • fix(ai-native): stabilize agentic virtual list interactions

  • fix(ai-native): stabilize virtualized session restore e2e

  • fix(ai-native): keep restored agentic session active

  • fix(ai-native): stabilize agentic chat e2e virtualization

  • fix(ai-native): preserve virtualized agentic history rows

  • test(ai-native): stabilize virtualized recovery e2e

  • fix(ai-native): preserve active task session on reload

  • fix(ai-native): clarify ACP session restoration

  • fix(ai-native): restore ACP slash command catalogs

  • fix(ai-native): sync agent task status after cancel

  • feat(ai-native): restore agent-owned ACP sessions

  • feat(ai-native): use agent-owned session browser

  • test(playwright): isolate temporary workspaces

  • fix(ai-native): align agent session creation and labels

  • feat(ai-native): complete agent-owned session workflow

  • feat(ai-native): default agent layout to split workbench

  • fix(ai-native): simplify initial task loading state

  • fix(ai-native): stabilize agent session e2e setup

  • fix(ai-native): preserve ACP request session context

  • fix(ai-native): preserve ACP restored user turns

  • test(playwright): align agentic session e2e coverage

Update stale side-entry and lifecycle expectations.

Wait for prompt acceptance and discovery convergence.

  • fix(ai-native): restore submitted ACP user turns

Retain submitted prompts in thread replay history.

Suppress matching Agent echoes to avoid duplicate user rows.

  • fix(ai-native): hide internal ACP prompt metadata

Strip the reserved WebMCP usage hint from restored user turns.

Keep the Agent prompt enrichment unchanged.

  • test(playwright): wait for ACP prompt acceptance

  • fix(ai-native): keep restored ACP sessions fast and stop assistant rows from stacking

Loading a long historical ACP session froze the main thread for tens of seconds and the restored assistant rows visually stacked over each other.

Freeze (profiled via DevTools trace, ~30s scripting):

  • react-highlight never sets a language- class, so highlight.js ran auto-detection over every full-size tool argument/result block at mount. Oversized blocks now render as plain text; sized blocks highlight with an explicit language (plaintext fallback).
  • every code block mount fired a leading-edge scrollIntoViewIfNeeded during the React commit (7s of forced layout). Restored blocks skip the mount scroll; streaming updates still follow output.
  • the attach snapshot rebuilt the whole ChatModel and remounted every row even when the transcript was identical. restoreLoadedSession now skips replacement when message ids match.

Stacking (geometry verified in a headless Chromium loop):

  • createMessageByAI/User clobbered an object-passed className with the undefined second argument, so chat_with_more_actions never reached the DOM and the absolutely positioned action bar (bottom: -40px) painted over the next message row. Propagate the object className and reserve an in-flow strip (thinking_container padding, bar at bottom: 0).
  • also adds the message/thinking-result copy actions and a 20px top margin for assistant rows in the chat panel.
  • feat(ai-native): show Agent Session Discovery Loading in the Session Browser

  • fix(ai-native): declare highlight.js dependency used by ChatEditor

  • fix(playwright): expand home-abbreviated tree paths when matching editor tabs

  • fix(ai-native): keep ACP sends reliable across the draft-bound session window

Product (packages/ai-native):

  • Sends clicked while the draft-bound session is still being created are reserved by the queued-turn runtime and dispatched on bind (“Starting task…” feedback); session restore keeps blocking sends via the existing live-ready gate (submitDisabled shows the sticky window through).
  • Latest intent (ADR-0004): superseding or discarding the draft while its session creation is in flight cancels the held turn instead of dispatching it into a session that lost its owner. ensureSessionModel() vetoes stale waiters with ACP_SESSION_CREATION_CANCELLED_ERROR_NAME (defined in acp-chat-queued-turns.ts), and the runtime drops the reserved turn silently without re-queueing or pausing with start-failed.
  • Input drafts become per-session: a Map keyed by bound session id with a draft-phase slot that migrates to the session it binds; cleared sessions, released draft-bound sessions and dispose prune their slots.

Tests:

  • e2e (tools/playwright): acp-chat-agentic-send-during-session-creation (in-window click dispatches once on bind), acp-chat-agentic-held-turn- cancelled-on-discard (supersede + explicit discard cancel the held turn), acp-chat-agentic-per-session-input-draft (switching sessions keeps each session its own unsent draft).
  • jest: acp-chat-view-header render tests lock the submitDisabled formula and per-cause connection copy for creation / restore / classic / ready states.

Test infra:

  • Mock ACP agent gains –new-session-delay-ms to open the creation window deterministically; the BDD fixture exposes it as newSessionDelayMs.
  • Playwright hooks capture the fixture browser and expose ensurePage(); loadAcpBddFixtureWorkbench heals a closed shared page at entry so multi-spec invocations pass reliably (top-level hooks only attach to the first spec file loaded in a worker).

Tracker: .scratch/acp-sticky-send/ (spec + resolved issues 01-04 with RED/GREEN evidence).

  • feat(ai-native): resolve relative file links against the Agent Session cwd

ChatMarkdown now prefers the launched Agent Session’s cwd (sessionModel.acpTarget.cwd) over the IDE workspace when resolving relative file links, with ChatReply and both chat views (classic + ACP agentic) passing it through. The mock ACP agent gains a file-link-agent-cwd fixture (emits relative paths that resolve against the agent home, with a decoy file planted in the IDE workspace) and the BDD fixture registry exposes it.

Covered by jest contract tests (chat-markdown-file-link, chat-reply) and a deterministic Playwright spec (acp-chat-agentic-agent-cwd-file-link) using the loopback e2e project-seeding hook.

  • feat(startup): prod entry chat shell visual contract + local prod scripts

Registers the design menubar slot in the prod entry, loads the kaitian iconfont in the entry styles, and trims the chat message action-bar reserve to 28px so the bar stops reading as oversized blank padding. Adds prod:clean/prod:build/prod:start/prod:open and start:dev npm scripts plus a local, evidence-capture-only prod-verify collector (self-described temporary; per its header, removed after evidence capture) and the startup-prod-entry-chat-shell scenario documenting the visual contract.

Bundle-level change: not exercised by the e2e runtime lane.

  • test(playwright): opt-in BDD evidence video recording in shared hooks

newContext records video only when OPENSUMI_BDD_VIDEO_DIR is set (BDD evidence captures screenshots separately), and the worker-level afterAll closes the shared context so recorded artifacts flush cleanly instead of relying on worker teardown.

  • docs: agent workflow docs and research notes

  • chore: ignore BDD runtime debris under tools/template/.sumi

  • fix(playwright): destructure a fixture in the agent-cwd file-link test

Playwright statically requires the test callback’s first argument to use object destructuring; the bare _fixtures parameter (introduced to satisfy the no-empty-pattern lint rule) made the spec fail at collection time. Use the repo convention ({ browser: _browser }, testInfo) instead — verified standalone against the local e2e stack (1 passed).

  • fix(ai-native): defer session config changes to the turn boundary

Product (packages/ai-native):

  • ACP agents are not required to tolerate session/set_config_option while a prompt is in flight — real agents crash and take the connection down. That turned a mid-turn model switch into the reported “queued turn stuck behind Paused · Agent error / Immediate Send silently loses the message” experience: the queued message only drains cleanly while the agent lives.
  • AcpChatInternalService.setSessionConfigOption now checks isAcpResponsePending(threadStatus) and, while a turn is running, stages the change in a per-session pending map (latest value per option id wins) instead of sending the RPC. The local model still updates optimistically so the picker reflects the user’s choice immediately.
  • Staged changes flush right before a request is dispatched (sendRequest), which covers queue drain, Immediate Send and manual sends — every turn boundary — and keeps deferring if the thread is somehow still pending. clearSessionModel drops its pending map so disposed sessions cannot leak.

Tests (packages/ai-native):

  • jest: while working, setSessionConfigOption holds the change locally and sends no RPC; sendRequest flushes staged changes (latest-wins) before dispatch once the thread settles; clearing the session drops pending changes. Suite: 56/56.
  • test(bdd): add a crash-on-config-change knob to the mock ACP agent
  • mock-acp-agent.mjs: –crash-on-config-change (env OPENSUMI_ACP_BDD_CRASH_ON_CONFIG_CHANGE) exits the mock when a session/set_config_option arrives while that session still has a prompt in flight, mimicking real agents that die on a mid-turn config change.
  • acp-bdd-fixture.ts: plumb crashOnConfigChange through as an agent arg + env (same pattern as longStreamTicks), so specs can arm the knob.
  • test(playwright): regression spec for mid-turn model switch boundary

Replaces the throwaway repro-model-switch-queue spec (deleted, it relied on pgrep/kill pid games) with acp-chat-agentic-model-switch-config-boundary:

  • fixture long-stream (25 ticks) with crashOnConfigChange armed, so any session/set_config_option that reaches the agent mid-prompt kills it and the run goes red deterministically;
  • flow: long turn generates -> mid-turn model switch (Stop stays visible, tail keeps growing -> the change stayed local) -> second message queues -> turn one ends naturally and the queue drains itself -> turn two runs to completion -> the whole run collects zero ‘ACP connection closed’ console errors and the queue never reports agent-error;
  • turn-two completion is asserted by scrolling the virtual list to the bottom and polling the last message row for its final actions (‘Afresh’): after the queue collapses the virtual list stops following the stream (drain-transition UI quirk, tracked separately in the model-switch-queue tracker), but the completed reply is reachable and must render.

Verified locally: pre-fix red (mock CRASH mid-turn, queue pauses with agent error), post-fix green x3 (including after debug cleanup).

  • docs(scratch): model-switch-queue tracker (spec + diagnosis issues)

Diagnosis trail and outcomes for the “model switch mid-turn breaks the queued turn” report:

  • spec.md: symptoms, final acceptance, feedback loop, all phases done;
  • 01 (resolved): defer session/set_config_option to the turn boundary — root cause evidence, implementation seam and jest/e2e/server-log proof;
  • 02 (resolved): crash-on-config-change instrument + deterministic regression spec (pre-fix red, post-fix green x3);
  • 03 (claimed): drain-transition UI quirks left open — Stop affordance missing and the virtual message list no longer following the stream for auto-drained turns (content itself is delivered and completes).
  • test(playwright): park the pointer before picking the model option

CI (ubuntu) failed the boundary spec while clicking the open dropdown option: the model selector sits under its disabled-tooltip while a turn streams (“Clear or create session to change model”), and on a slower machine that tooltip pops above the open option list and intercepts the click for the whole actionability window. Park the pointer over the message list first so the hover tooltip closes, then click the option; also make the post-switch stream-growth check an expect.poll instead of a fixed 5s window that a ~2.5-3s CI chunk cadence can starve.

  • fix(ai-native): make New Session draft carry and ArrowUp recall survive focus races
  • seed the bound session’s unsent draft into the ACP_INPUT_DRAFT_SLOT before enterDraftSession clears it, so the layout-aware New Session draft is kept regardless of how session-switch restore races the phase transition
  • record MentionInput history whenever an accepted send lands on a mounted editor; keep the DOM clear behind the generation guard (ArrowUp recall no longer loses the entry when session restore bumps editorGeneration)
  • input-send e2e: recall via expect.poll re-press so a CI popup stealing focus between focus() and keypress cannot drop the recall
  • jest: cover non-empty carry + empty non-carry in enterAgenticTaskDraft
  • scratch: model-switch-queue issues 02 evidence + issue 04 brief

Local e2e: layout-aware / input-send / per-session-input-draft / draft-footer green (–retries=0); model-switch-config-boundary green.

  • docs(scratch): mark model-switch-queue issue 04 resolved with CI evidence

  • chore: keep local agent artifacts and yarn bundles out of the repo

  • ignore and untrack .scratch/ and docs/ (local agent notes)
  • untrack .yarn/releases/ bundles, drop the !.yarn/releases negation
  • chore: keep the pinned yarn 4.4.1 bundle tracked

  • chore: keep ai-native package docs local

  • chore: keep the branch BDD delta report local

  • fix(ai-native): keep draft agent and project labels after draft-bound session creation

  • fix(ai-native): stop dumping full ACP session history into the browser console

Replace the console.log in ACPSessionProvider.loadSession with a logger.debug that records only the historyUpdates count, so user prompts, assistant replies and tool I/O no longer leak to the console. Drop the manager test that asserted the full-history log and extend the shared provider logger mock with debug.

  • chore: anchor the root docs ignore rule to the repo root

The unanchored docs/ pattern matched every docs/ directory in the repo, silently swallowing new files under tracked ones like packages/connection/docs/.

  • fix(ai-native): harden ACP session lifecycle per review
  • acp-thread: return early when the child process already exited by signal; expose setPendingLocalUserMessageEcho so sendPrompt can align the expected echo with the prompt actually sent (capability hint included) while user history keeps the raw prompt
  • acp-agent: skip standby reconcile while a retry backoff is pending; map cancelled warmups to AcpSessionCreationCancelledError and let other warmup failures fall back to cold start; track getSessionCapabilities as a foreground operation and recover the thread after initialization failures
  • chat-manager: compare the last message content in isSameActiveTranscript so streaming-updated snapshots still apply
  • chat-internal: never release the current model or a pending selection when cleaning up stale session loads
  • playwright: drop the retry click inside the request-count poll; bind page timeout and console collection after the fixture loader
14天前13812次提交

OpenSumi

A framework helps you quickly build AI Native IDE products.

perview

🌟 Getting Started

Here you can find some of our example projects and templates:

⚡️ Development

$ yarn install
$ yarn run init
$ yarn run download-extension  # Optional
$ yarn run start

By default, the tools/workspace folder in the project would be opened, or you can run the project by specifying the directory in the following way:

$ MY_WORKSPACE={local_path} yarn run start

Usually, you may still encounter some system-level environment dependencies. You can visit Development Environment Preparation to see how to install the corresponding environment dependencies.

📕 Documentation

For complete documentation: opensumi.com

📍 ReleaseNotes & BreakingChanges

You can see all the releasenotes and breaking changes here: CHANGELOG.md.

🔥 Contributing

Read through our Contributing Guide to learn about our submission process, coding rules and more.

🙋‍♀️ Want to Help?

Want to report a bug, contribute some code, or improve documentation? Excellent! Read up on our Contributing Guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.

🧑‍💻 Needs some help?

Go to our issues or discussions to create a topic, it will be resolved as soon as we can.

✨ Contributors

Let’s build a better OpenSumi together.

Top Contributors of ant-design/ant-design - Last 28 days Performance Stats of ant-design/ant-design - Last 28 days
Active participants of opensumi - past 28 days

We warmly invite contributions from everyone. Before you get started, please take a moment to review our Contributing Guide. Feel free to share your ideas through Pull Requests or GitHub Issues.

📃 License

Copyright (c) 2019-present Alibaba Group Holding Limited, Ant Group Co. Ltd.

Licensed under the MIT license.

This project contains various third-party code under other open source licenses.

See the NOTICE.md file for more information.

关于

Mirror of opensumi/core. 🚀 A framework helps you quickly build Cloud or Desktop IDE products.

252.6 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号