Skip to content

feat(native-chat): add TRAE CLI chat support - #43564

Open
Aues6uen11Z wants to merge 34 commits into
stablyai:mainfrom
Aues6uen11Z:feat-trae-chat-ui
Open

Aues6uen11Z wants to merge 34 commits into
stablyai:mainfrom
Aues6uen11Z:feat-trae-chat-ui

Conversation

@Aues6uen11Z

@Aues6uen11Z Aues6uen11Z commented Nov 17, 2026 •

Copy link
Copy Markdown

ELI5

TRAE CLI can now use Orca's native Chat UI through the existing Trae agent entry. Users can continue their CLI conversations in chat and use the familiar conversation, approval, and task controls.

What Changed

  • Offer Chat and TUI through the same Trae agent entry.
  • Stream replies and reasoning; show tool progress/results, file changes, and images. Render approval requests and questions with Orca's existing interactive cards.
  • Use the CLI's available model, effort, and interaction-mode choices. Display model load, daily quota, weekly quota, and context usage when available.
  • Offer Standard/Max context choices for supported models. Preserve choices across resume and model changes, use Standard for models without Max, and keep running turns on their accepted settings. Display the CLI's reason if a message is rejected.
  • Resume conversations started in the CLI with their history and titles. Add fork and rewind controls where supported, and keep a conversation from appearing as duplicate history entries.
  • Support /compact with a visible context-compaction divider, /recap, and /goal with goal status and controls.
  • Show subagent activity and background command contents/status, with controls to stop individual tasks.
  • Show the current queue position while a reply waits for capacity, and keep remote history lists responsive after idle periods or restarts.

Why

Extend the existing TUI integration so users can continue the same conversations in native chat, with controls consistent with Orca's other supported agents.

The implementation uses a dedicated TRAE CLI adapter and reuses Orca's existing chat components and session lifecycle. This keeps the integration independent of Codex while following the established Orca structure.

Paired-runtime testing exposed history scans that exceeded the default RPC deadline and repeatedly started with a cold parse cache. The shared Session History listing now uses a consistent timeout across desktop and Web RPC paths, and headless Orca runtimes initialize the existing persistent parse cache used by desktop startup. These supporting changes apply to all agents because they share the history discovery path.

Linked Issue

Fixes #17944. Builds on #10763.

Visual Proof

Before: the Trae agent opened CLI/TUI conversations.

After: the same agent entry offers Chat and CLI, and Chat opens Orca's native conversation interface.

Agent preference

Trae Chat and CLI preference

Native Chat

Trae native Chat interface

Testing

I have used this development branch locally on macOS and with a paired Linux Orca server, without encountering any obvious problems in regular use. I will actively follow up on reported issues and provide fixes.

  • Merged upstream main; the latest full-project pnpm tc passed.

  • Earlier full local pnpm lint: 48 checks passed. Full pnpm build passed, including desktop, Web, mobile Web, and macOS native artifacts.

  • Scoped regressions: 19 files, 68 retained tests passed, covering TRAE CLI controls, model selection, history, queueing, child tasks, and affected shared session/journal behavior. Added cases were verified against their pre-fix implementations, including cancellation, concurrent history writes, custom naming templates, and goal/turn races.

  • Pre-push pnpm check:changed: 40 non-unit checks passed. Expanded related-unit selection exceeded the configured time limit after spreading beyond this integration; scoped checks are reported under the project's scoping rule. This is not a complete gate pass. Full repository unit and platform coverage remains for CI. An earlier full-suite attempt also reproduced three failures on the then-current upstream base in the same environment.

  • Earlier paired Linux validation checked Standard/Max startup and settings changes against the CLI. Regular-use testing is described above; this does not claim inference coverage for every model.

  • Headless component captures covered configurable and fixed model settings, inherited values, model switching, and Standard/Max in light/dark themes and a 320px fixture layout (18 captures). Full Electron and platform end-to-end coverage remains for CI. Windows sandbox startup was covered by protocol simulation.

  • I manually tested these changes locally

  • Automated tests added/updated

  • Added regression cases fail when their corresponding fixes are removed

Performance

Additional CLI processes and event handling are scoped to TRAE chats and model discovery. The integration uses Orca's existing model cache and history-loading paths. Shared option changes extend existing projections; the descriptor extraction preserves behavior without adding polling or background tasks.

Risk

Level: Medium

Approval handling and session identity during resume/fork/rewind are the most sensitive boundaries; errors could leave requests waiting or display incorrect history. Platform guards and host routing follow the existing structured-agent contracts.

A revert removes native-chat support. CLI rollout files remain resumable in the TUI; chat records using the new transport require a supporting build.

AI Disclosure

AI-assisted implementation and review through TRAE CLI using GPT and DeepSeek.

Review

Reviewed approval decisions, command completion, history restoration, platform guards, paired-host behavior, folder workspaces, web/mobile presentation, and history-list performance. Reported defects were fixed with regression coverage, and the latest upstream changes were incorporated.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer source or assets are copied or translated.

Notes

Requires TRAE CLI 0.214.1 or newer.

Two documented entries in config/main-blocking-helper-baseline.txt are proposed for reviewer sign-off under the one-shot startup exception. They cover the existing managed-spawn diagnostics and WSL command-resolution helpers used during native provider launch.

Checklist

  • Focused on TRAE CLI chat integration — substantial adapter diff with supporting changes to shared session infrastructure
  • What changed and why explained
  • Risk and rollback explained
  • Visual proof attached above, with the prior behavior described
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, remote, and path impact considered
  • Full repository lint/test/build coverage complete — full local lint/build and scoped regressions passed; broader unit and platform CI coverage is pending

@Aues6uen11Z
Aues6uen11Z marked this pull request as ready for review November 17, 2026 16:35
Copilot AI balanced review requested due to automatic review settings November 17, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

# Conflicts:
#	src/main/acp/session/acp-structured-resume-history.ts
#	src/shared/agent-session/options/structured-agent-session-options.ts
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The PR adds a structured Trae CLI runtime, including process management, session startup, message handling, timeline projection, controls, and history restoration. It adds Trae session discovery and indexing to AI Vault. Shared session code gains recap and conversation-history adapter support, context-mode options, and provider-timeline rewind handling. The changes also update journal attach and epoch-replacement flows, add reusable provider timeline and tool-result utilities, and include runtime, history, and UI tests and fixtures.

Merge Risk: Minimal · previous review 3aa1f

This PR adds TRAE CLI chat support. The earlier concerns about effort carry-over on model change, stale queue state after a thread revert, and Trae history restoration on attach appear fixed at the current head. I found no remaining concrete merge-blocking risk. Full repository CI and platform coverage should still pass before merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(native-chat): add TRAE CLI chat support" matches the main change. The PR adds a native Chat option for the Trae agent entry, with a dedicated TRAE CLI adapter, streaming, approvals, hi…
Linked Issues check Passed Primary requirement: [#17944] asks for an explicit flow that attaches an existing Trae CLI session to an Orca-native agent record. The issue leaves the interface open. It asks to preserve provider and…
Out of Scope Changes check Passed Most changed files implement the TRAE CLI native-chat integration. These include the src/main/traex/ adapter modules, the trae entries in the AI Vault, rewind, journal, naming, and permission modu…
Description check Passed The description follows the repository template. Every required section is present: ELI5, What Changed, Why, Linked Issue (Fixes #17944), Visual Proof with before/after images, Testing, Performance, R…
Full details: Title check

Explanation

The title "feat(native-chat): add TRAE CLI chat support" matches the main change. The PR adds a native Chat option for the Trae agent entry, with a dedicated TRAE CLI adapter, streaming, approvals, history, and related controls. The title is concise and specific. It omits the supporting shared history-timeout and parse-cache changes, which is acceptable.

Full details: Linked Issues check

Explanation

Primary requirement: [#17944] asks for an explicit flow that attaches an existing Trae CLI session to an Orca-native agent record. The issue leaves the interface open. It asks to preserve provider and session ID, existing history, worktree/cwd, title, live status, and resume metadata, and to avoid duplicate live sessions.

Evidence from the whole-PR summary (merge base a7a690f to head 3aa1f61):
(1) Attach path: CLI_CONVERSATION_ADOPTING_AGENTS includes trae. attachSessionJournalHistory attaches journal history under a lock, waits for any pending adopted transcript, and rechecks ownership before import. It refuses with agent_session_ownership_unknown (reason leaseMoved) when the record, fence, or claim changed.
(2) Provider identity and history: TRAEX_CLI_CONVERSATIONS finds the transcript by provider session ID and selects the newest file. createTraexConversationHistoryImporter validates the adopted source identity and imports primary and child turns. readPendingAdoptedTranscript and importAdoptedTranscript feed the adopted history into the native record.
(3) Resume metadata: openTraexSession resumes a saved thread and restores history and child work. A missing rollout starts a new thread only when the launch may be unsaved, and it records the superseded handle.
(4) Duplicate live sessions: conversationOpenElsewhere refuses a second writer.
(5) Title and cwd: the session-index title refresh covers trae, and AI_VAULT_SCOPE_CWD_SOURCES extracts cwd for trae.

The PR adds no separate import UI or CLI command. The issue allows the implementation to choose the interface. The attach-on-resume path covers the stated preservation and duplicate-session criteria. Live status and cwd were checked through the summary, not a full code read. Tests were not run in this assessment. The adopted-import test file covers cancelled, completed, concurrent, and unimported cases.

Related issues #11214, #5376, #5232, and #5978 are context only. The PR cites #10763 as a base. That issue was not provided, so it adds no requirements.

Full details: Out of Scope Changes check

Explanation

Most changed files implement the TRAE CLI native-chat integration. These include the src/main/traex/ adapter modules, the trae entries in the AI Vault, rewind, journal, naming, and permission modules, and the renderer option and slash-command updates.

Shared changes support the adapter and are described in the PR description. These include the Session History timeout (AI_VAULT_SINGLE_HOST_LIST_TIMEOUT_MS in web-ai-vault-api.ts), the parse-cache initialization in orcad-entry.ts, and the Codex-to-provider helper renames and moves to shared native-chat modules. The moves are refactors that let Trae reuse the same logic. The Codex-side translation files now delegate to shared helpers, and the summary shows no behavior change beyond the shared call sites.

The config/main-blocking-helper-baseline.txt entries are flagged in the PR description for reviewer sign-off. They are documented, not demonstrated unrelated changes.

The previous review flagged the removal of the react-grab/styles.css import in src/renderer/src/main.tsx. The current summary does not list that file, so this assessment could not confirm or dismiss the change. It is a development-only styling change and is not a demonstrated unrelated change. Reviewers should confirm that the removal is intended.

Full details: Description check

Explanation

The description follows the repository template. Every required section is present: ELI5, What Changed, Why, Linked Issue (Fixes #17944), Visual Proof with before/after images, Testing, Performance, Risk (Level: Medium, with a rollback note), AI Disclosure, Review, the agent skill upstream boundary checkbox, and Checklist. The Performance section is filled in, though it is not a single line. The Testing section gives concrete commands, counts, and platforms. Two gaps remain. The 'Full repository lint/test/build coverage' checklist item is unchecked, and the description says the expanded unit selection timed out, so full CI coverage is still pending. The 'Linked Issue' is #17944, but the PR objectives note that the PR does not clearly deliver the issue's requested import/attach flow. The description also has no explicit statement of whether that issue scope is met.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dac8eebb-f40b-4655-84f0-ae0cbdf9f36d
Commits

Reviewing files that changed from the base of the PR and between d6807ad and 3aa1f61.

Files selected for processing: 14

  • config/main-blocking-helper-baseline.txt
  • src/cli/skills/bundled-skill-guides.ts
  • src/main/native-chat/agent-session-journal/journal-writer-command.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-option-models.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-options-read.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-resting-options.ts
  • src/main/runtime/agent-session/installation/structured-agent-runtime-metadata.ts
  • src/main/runtime/agent-session/installation/structured-agent-runtime-registrations.ts
  • src/shared/agent-session/options/model-catalog/structured-agent-session-discovered-model.ts
  • src/shared/agent-session/options/structured-agent-session-options.ts
  • src/shared/agent-session/options/view/structured-agent-session-option-snapshot.ts
  • src/shared/agent-session/view/structured-agent-cli-conversation-adoption.ts
  • src/shared/agent-session/view/structured-agent-session-composer.ts
  • src/shared/native-chat/input/native-chat-session-options.ts
Files with no reviewable changes: 1

  • src/shared/agent-session/options/structured-agent-session-options.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 12

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Clear a saved effort that the newly selected… · structured-agent-session-option-view.ts:197-203

src/shared/agent-session/options/view/structured-agent-session-option-view.ts:197-203
Minor · Functional Correctness · Quick win

Clear a saved effort that the newly selected Trae model does not offer.

Changing the Trae model keeps the previously saved effort. Effort is checked only when it is picked. The next message then sends that effort in turn/start, even when the new model offers no such effort. The view also shows the stale value. TRAE CLI can reject that request, and the rejection surfaces as a provider rejection. Switching back to a model that offers the effort, or starting a new chat, recovers from it.

Apply the same offered-effort check when the model changes, and drop the effort if the new model does not offer it:

Suggested fix

   signal?.throwIfAborted()
   // Model/effort are per-turn inputs; picking while a turn runs must not mutate that turn.
   session.options[key] = value
+  if (
+    key === 'model' &&
+    session.options.effort !== undefined &&
+    !model.supportedReasoningEfforts.some((effort) => effort.reasoningEffort === session.options.effort)
+  ) {
+    delete session.options.effort
+  }

Verification of this edit: for a failing input, the saved high moves to a model with no efforts. The check is true, the effort is deleted, and traexNativeExecutionSettings no longer adds reasoning_effort. For an accepted input, the saved high moves to a model that lists high. The check is false, the effort is kept, and it is sent as before.

Nitpick comments: 1

src/main/traex/traex-session-controls.test.ts: 1

176-176: Trivial · Maintainability & Code Quality · Quick win

Wait for the turn created by each dispatch.

On the second iteration, this predicate also accepts the first turn's completed state. It does not identify completion of the custom-id dispatch.

Capture the previous turn ID before dispatch. Then require a different completed turn, as the context-mode test does at Lines 205-218. This makes the regression check verify completion for both models.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d87abf4c-f352-4d3f-b481-888523a9e9e6
Commits

Reviewing files that changed from the base of the PR and between 55044b5 and 9aa9645.

Files selected for processing: 171

  • src/main/acp/history/acp-history-journal-overlay.ts
  • src/main/acp/session/acp-structured-resume-history.ts
  • src/main/ai-vault-search/indexing/session-search-index-consumer.ts
  • src/main/ai-vault-search/indexing/session-search-trae-title.test.ts
  • src/main/ai-vault/discovery/session-scanner-agent-sources.ts
  • src/main/ai-vault/parse-cache/session-scanner-parse-cache.ts
  • src/main/ai-vault/parsing/session-root-dedup.ts
  • src/main/ai-vault/parsing/session-scanner-agent-parser.ts
  • src/main/ai-vault/scanner-fixtures/session-scanner-test-fixtures.ts
  • src/main/ai-vault/scanners/codex/session-scanner-codex-cached-title.ts
  • src/main/ai-vault/scanners/codex/session-scanner-codex-title-index.ts
  • src/main/ai-vault/scanners/session-index-title-refresh.ts
  • src/main/ai-vault/scope/session-scope-cwd.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/session-titles/session-title-file-reader.ts
  • src/main/codex/structured/items/codex-collab-agent-item-translation.ts
  • src/main/codex/structured/items/codex-command-action-class.ts
  • src/main/codex/structured/items/codex-image-item-translation.ts
  • src/main/codex/structured/prompts/codex-file-change-approval-detail.ts
  • src/main/codex/structured/threads/codex-structured-thread-goal.test.ts
  • src/main/codex/structured/turns/codex-structured-message-options.test.ts
  • src/main/ipc/ai-vault/ai-vault.ts
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-entry-lifetime.ts
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-models.ts
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-persistence.ts
  • src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts
  • src/main/native-chat/agent-session-journal/context-epochs/journal-history-origin.ts
  • src/main/native-chat/agent-session-journal/journal-domain-provider-rewind-cut.ts
  • src/main/native-chat/agent-session-journal/journal-domain-rewind-cut.ts
  • src/main/native-chat/agent-session-journal/journal-domain-rewind-membership.ts
  • src/main/native-chat/agent-session-journal/journal-domain-rewind-removal.ts
  • src/main/native-chat/agent-session-journal/journal-sql-provider-rewind.test.ts
  • src/main/native-chat/agent-session-journal/journal-sql-rewind.test-fixture.ts
  • src/main/native-chat/agent-session-timeline/provider-file-change-approval-detail.ts
  • src/main/native-chat/agent-session-timeline/provider-image-item.ts
  • src/main/native-chat/agent-session-timeline/provider-timeline-event.ts
  • src/main/native-chat/agent-session-timeline/provider-timeline-history-overlay.ts
  • src/main/native-chat/agent-session-timeline/provider-timeline-settlement.ts
  • src/main/native-chat/agent-session-timeline/provider-timeline-turn-decisions.ts
  • src/main/native-chat/agent-session-timeline/provider-timeline-unused-conversation.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-adopted-import.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-flow.ts
  • src/main/native-chat/agent-session-wire/delivery/structured-agent-session-delivery-loop.ts
  • src/main/native-chat/agent-session-wire/delivery/structured-agent-session-queued-gate.ts
  • src/main/native-chat/agent-session-wire/observations/structured-agent-session-status-summary-equality.ts
  • src/main/native-chat/agent-session-wire/observations/structured-agent-session-status-summary.ts
  • src/main/native-chat/agent-session-wire/operations/structured-agent-session-command-turn.ts
  • src/main/native-chat/agent-session-wire/operations/structured-agent-session-mutation-plans.ts
  • src/main/native-chat/agent-session-wire/operations/structured-conversation-command-controller.ts
  • src/main/native-chat/agent-session-wire/operations/structured-conversation-compaction.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-execution-options.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-message-options.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-option-intent.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-option-models.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-options-read.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-resting-options.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-adapter-router.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-adapter.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-command-run.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-conversation-history.ts
  • src/main/orcad/host-runtime/orcad-entry.ts
  • src/main/runtime/agent-session/installation/structured-agent-runtime-metadata.ts
  • src/main/runtime/agent-session/installation/structured-agent-runtime-registrations.ts
  • src/main/runtime/agent-session/naming/structured-chat-naming-runtime.ts
  • src/main/traex/__fixtures__/traex-scripted-app-server.mjs
  • src/main/traex/traex-agent-definition.ts
  • src/main/traex/traex-app-server-connection.ts
  • src/main/traex/traex-at-rest-commands.ts
  • src/main/traex/traex-background-task-stops.ts
  • src/main/traex/traex-child-announcements.ts
  • src/main/traex/traex-child-history.ts
  • src/main/traex/traex-child-work-evidence.ts
  • src/main/traex/traex-child-work.test.ts
  • src/main/traex/traex-child-work.ts
  • src/main/traex/traex-cli-conversations.test.ts
  • src/main/traex/traex-cli-conversations.ts
  • src/main/traex/traex-context-usage.ts
  • src/main/traex/traex-conversation-history-import.ts
  • src/main/traex/traex-execution-settings.ts
  • src/main/traex/traex-goal-timeline.ts
  • src/main/traex/traex-history-projection.ts
  • src/main/traex/traex-item-translation.ts
  • src/main/traex/traex-launch-resolution.ts
  • src/main/traex/traex-message-dispatch.ts
  • src/main/traex/traex-message-input.ts
  • src/main/traex/traex-model-catalog-probe.ts
  • src/main/traex/traex-model-catalog.ts
  • src/main/traex/traex-model-queue.test.ts
  • src/main/traex/traex-model-queue.ts
  • src/main/traex/traex-permission-mode.ts
  • src/main/traex/traex-prompt-content.ts
  • src/main/traex/traex-prompt-registry.ts
  • src/main/traex/traex-protocol.ts
  • src/main/traex/traex-rewind.ts
  • src/main/traex/traex-runtime-metadata.ts
  • src/main/traex/traex-runtime-registration.ts
  • src/main/traex/traex-session-adapter.test.ts
  • src/main/traex/traex-session-adapter.ts
  • src/main/traex/traex-session-child-work.test.ts
  • src/main/traex/traex-session-commands.ts
  • src/main/traex/traex-session-compaction.ts
  • src/main/traex/traex-session-contract.ts
  • src/main/traex/traex-session-controls.test.ts
  • src/main/traex/traex-session-discovery.ts
  • src/main/traex/traex-session-extras.ts
  • src/main/traex/traex-session-history-scan.ts
  • src/main/traex/traex-session-notifications.ts
  • src/main/traex/traex-session-options.ts
  • src/main/traex/traex-session-start.ts
  • src/main/traex/traex-session.ts
  • src/main/traex/traex-stream-items.ts
  • src/main/traex/traex-text-generation.ts
  • src/main/traex/traex-thread-goal.ts
  • src/main/traex/traex-thread-history.ts
  • src/main/traex/traex-thread-naming.ts
  • src/main/traex/traex-thread-settings.ts
  • src/main/traex/traex-timeline-contract.test.ts
  • src/main/traex/traex-timeline-item-key.ts
  • src/main/traex/traex-timeline.ts
  • src/main/traex/traex-turn-cancel.ts
  • src/main/traex/traex-turn-notices.ts
  • src/main/traex/traex-windows-sandbox.ts
  • src/renderer/src/components/native-chat/composer/pickers/use-native-chat-composer-catalog.ts
  • src/renderer/src/components/native-chat/messages/reasoning/NativeChatTurnActivityLine.fixture.tsx
  • src/renderer/src/components/native-chat/session/options/controls/NativeChatSessionOptionRows.tsx
  • src/renderer/src/components/native-chat/session/options/controls/NativeChatTraeModels.fixture.tsx
  • src/renderer/src/main.tsx
  • src/renderer/src/runtime/hosted-terminals/creation/agent-launch/agent-resume-host-authority-capability.ts
  • src/renderer/src/web/preload-api/agents/web-ai-vault-api.ts
  • src/shared/agent-launch/catalog/resumable-tui-agents.ts
  • src/shared/agent-launch/permissions/agent-chat-permission-support.ts
  • src/shared/agent-launch/startup/agent-resume-argv.ts
  • src/shared/agent-session/agent-session-wire.ts
  • src/shared/agent-session/capabilities/agent-session-capabilities.ts
  • src/shared/agent-session/conversation-context/agent-session-conversation-command.ts
  • src/shared/agent-session/failures/agent-session-argument-problem.ts
  • src/shared/agent-session/lifecycle/agent-session-resume.ts
  • src/shared/agent-session/lifecycle/agent-session-rewind-targets.test.ts
  • src/shared/agent-session/lifecycle/resume/agent-session-resume-runtime-capabilities.ts
  • src/shared/agent-session/lifecycle/rewind/agent-session-rewind-targets.ts
  • src/shared/agent-session/options/catalog-providers/agent-session-option-catalog-types.ts
  • src/shared/agent-session/options/codex-message-compiler.ts
  • src/shared/agent-session/options/model-catalog/agent-model-catalog-ownership.ts
  • src/shared/agent-session/options/model-catalog/agent-session-context-mode.ts
  • src/shared/agent-session/options/model-catalog/agent-session-model-option.ts
  • src/shared/agent-session/options/model-catalog/structured-agent-session-discovered-model.ts
  • src/shared/agent-session/options/model-catalog/structured-agent-session-unlisted-effort.ts
  • src/shared/agent-session/options/permissions/agent-session-interaction-mode.ts
  • src/shared/agent-session/options/protocol/agent-session-execution-options.ts
  • src/shared/agent-session/options/protocol/agent-session-options-result.ts
  • src/shared/agent-session/options/reconciliation/structured-agent-session-option-state.ts
  • src/shared/agent-session/options/structured-agent-session-options.ts
  • src/shared/agent-session/options/view/structured-agent-session-option-snapshot.ts
  • src/shared/agent-session/options/view/structured-agent-session-option-view.test.ts
  • src/shared/agent-session/options/view/structured-agent-session-option-view.ts
  • src/shared/agent-session/view/structured-agent-cli-conversation-adoption.ts
  • src/shared/agent-session/view/structured-agent-session-composer.ts
  • src/shared/agent-session/view/structured-agent-session-slash-menu.ts
  • src/shared/ai-vault/contracts/ai-vault-session-title.ts
  • src/shared/ai-vault/contracts/ai-vault-types.ts
  • src/shared/ai-vault/resume/ai-vault-resume-command.ts
  • src/shared/ai-vault/session-display/ai-vault-session-log-resource.ts
  • src/shared/native-chat/input/commands/native-chat-agent-profiles.ts
  • src/shared/native-chat/input/native-chat-session-options.ts
  • src/shared/native-chat/input/questions/codex-async-question-input.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-defaults.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-labels.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-snapshot.ts
  • src/shared/native-chat/tools/native-chat-agent-tool-result.ts
  • src/shared/native-chat/tools/native-chat-command-actions.ts
  • src/shared/native-chat/transcript/notices/native-chat-notice.ts
Files with no reviewable changes: 1

  • src/main/ai-vault/scanners/codex/session-scanner-codex-cached-title.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/main/traex/traex-model-queue.ts Resolved
Comment thread src/main/traex/traex-prompt-registry.ts Resolved
Comment thread src/main/traex/traex-session-adapter.ts Resolved
Comment thread src/main/traex/traex-session-extras.ts Resolved
Comment thread src/main/traex/traex-thread-naming.ts Resolved
Comment thread src/main/traex/traex-turn-cancel.ts Resolved
Comment thread src/main/traex/traex-windows-sandbox.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Major · Pass the adapter to the retry read in… · structured-agent-session-adopted-import.ts:192

src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-adopted-import.ts:192
Major · Data Integrity & Integration · Quick win

Pass the adapter to the retry read in applyAdoptedTranscript.

On an existing record with journal sequence 1, applyAdoptedTranscript reads the transcript without the adapter. The legacy importer does not support Trae, so the retry fails with an unsupported-agent error and cannot restore history. This applies when a failed adoption leaves its record and initial journal in place.

Thread the adapter from the attach flow through importAdoptedTranscript into the retry read.

Suggested fix

--- a/src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-flow.ts
+++ b/src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-flow.ts
@@
-      await importAdoptedTranscript(params, journal, acquired, preparedTranscript.items, { store })
+      await importAdoptedTranscript(params, journal, acquired, preparedTranscript.items, {
+        store,
+        adapter: input.adapter
+      })
--- a/src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-adopted-import.ts
+++ b/src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-adopted-import.ts
@@
 export async function importAdoptedTranscript(
   params: AgentSessionAttachParams,
   attached: AttachedJournal,
   record: AgentSessionRecord,
   prepared: JournalReplacementItem[] | null,
-  options: { uncommittedCreate?: true; store?: AgentSessionRecordStore } = {}
+  options: {
+    uncommittedCreate?: true
+    store?: AgentSessionRecordStore
+    adapter?: Pick<StructuredAgentSessionAdapter, 'readConversationHistory'>
+  } = {}
 ): Promise<JournalForkInstall | undefined> {
@@
-  await applyAdoptedTranscript(params, attached, record, prepared, options.store)
+  await applyAdoptedTranscript(params, attached, record, prepared, options.store, options.adapter)
   return undefined
 }
 
 async function applyAdoptedTranscript(
   params: AgentSessionAttachParams,
   attached: AttachedJournal,
   record: AgentSessionRecord,
   prepared: JournalReplacementItem[] | null,
-  store?: AgentSessionRecordStore
+  store?: AgentSessionRecordStore,
+  adapter?: Pick<StructuredAgentSessionAdapter, 'readConversationHistory'>
 ): Promise<void> {
@@
-  const read = await readAdoptedTranscript(params)
+  const read = await readAdoptedTranscript(params, undefined, adapter)
   if (!read?.length) {
     throw agentSessionRefusalError('agent_session_identity_required', {
       reason: 'transcriptUnreadable'
     })
   }
-  await applyAdoptedTranscript(params, attached, record, read, store)
+  await applyAdoptedTranscript(params, attached, record, read, store, adapter)
 }
Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b6fb2b28-1536-4d07-a2fb-a5f931c1e23c
Commits

Reviewing files that changed from the base of the PR and between 9aa9645 and 47a677b.

Files selected for processing: 12

  • src/main/ai-vault/session-scanner-types.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-adopted-import.ts
  • src/main/native-chat/agent-session-wire/observations/structured-agent-session-status-summary-equality.ts
  • src/main/native-chat/agent-session-wire/observations/structured-agent-session-status-summary.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-at-rest-command-router.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-adapter-router.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-adapter.ts
  • src/main/runtime/agent-session/installation/structured-agent-runtime-metadata.ts
  • src/main/runtime/agent-session/installation/structured-agent-runtime-registrations.ts
  • src/shared/agent-session/options/structured-agent-session-options.ts
  • src/shared/settings/default-global-settings.ts
  • src/shared/source-control/ai/settings/source-control-ai-settings.ts
Files with no reviewable changes: 1

  • src/shared/agent-session/options/structured-agent-session-options.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Keep startup failures and cancellations associated with their original
operation. Retry undelivered mode approvals, discard stale queue and
naming results, and clear incompatible efforts when models change.

Preserve child history attribution, use the native reader on adoption
retries, and validate fork history before creating a copy. Refresh the
generated plugin references for Trae resume support.
Propose two startup baseline entries for reviewer sign-off under the new blocking-helper gate. They cover the existing managed-spawn diagnostics and WSL command-resolution helpers used by native provider launches.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 13062e48-c1ea-46a4-99d8-f270a3669f18
Commits

Reviewing files that changed from the base of the PR and between 47a677b and 39bb352.

Files selected for processing: 49

  • config/main-blocking-helper-baseline.txt
  • skill-guides/orca-plugin-authoring/references/host-api.md
  • src/cli/skills/bundled-skill-guides.ts
  • src/main/ai-vault/discovery/session-scanner-agent-sources.ts
  • src/main/ai-vault/parsing/session-scanner-agent-parser.ts
  • src/main/native-chat/agent-session-timeline/provider-image-item.test.ts
  • src/main/native-chat/agent-session-timeline/provider-image-item.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-adopted-import.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-flow.ts
  • src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-adopted-import.test.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-option-intent.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-session-adapter-router.ts
  • src/main/runtime/agent-session/installation/structured-agent-runtime-metadata.ts
  • src/main/runtime/agent-session/installation/structured-agent-runtime-registrations.ts
  • src/main/runtime/agent-session/naming/structured-chat-naming-runtime.ts
  • src/main/runtime/agent-session/records/agent-session-record-options.test.ts
  • src/main/runtime/agent-session/records/agent-session-record-options.ts
  • src/main/traex/__fixtures__/traex-scripted-app-server.mjs
  • src/main/traex/__fixtures__/traex-scripted-model-catalog.mjs
  • src/main/traex/traex-execution-settings.ts
  • src/main/traex/traex-history-projection.ts
  • src/main/traex/traex-model-queue.test.ts
  • src/main/traex/traex-model-queue.ts
  • src/main/traex/traex-prompt-content.ts
  • src/main/traex/traex-prompt-registry.ts
  • src/main/traex/traex-runtime-registration.ts
  • src/main/traex/traex-session-adapter.ts
  • src/main/traex/traex-session-contract.ts
  • src/main/traex/traex-session-controls.test.ts
  • src/main/traex/traex-session-extras.ts
  • src/main/traex/traex-session-options.ts
  • src/main/traex/traex-session-start.ts
  • src/main/traex/traex-session-startup.test.ts
  • src/main/traex/traex-session.ts
  • src/main/traex/traex-start-failure.ts
  • src/main/traex/traex-thread-naming.test.ts
  • src/main/traex/traex-thread-naming.ts
  • src/main/traex/traex-timeline-contract.test.ts
  • src/main/traex/traex-turn-cancel.ts
  • src/main/traex/traex-windows-sandbox.ts
  • src/renderer/src/components/native-chat/session/options/controls/NativeChatSessionOptionRows.tsx
  • src/shared/agent-launch/permissions/agent-chat-permission-support.ts
  • src/shared/agent-launch/startup/agent-resume-argv.ts
  • src/shared/agent-session/agent-session-wire.ts
  • src/shared/agent-session/conversation-context/agent-session-conversation-command.ts
  • src/shared/agent-session/view/structured-agent-cli-conversation-adoption.ts
  • src/shared/ai-vault/resume/ai-vault-resume-command.ts
  • src/shared/ai-vault/session-display/ai-vault-session-log-resource.ts
  • src/shared/native-chat/input/session-options/native-chat-session-option-labels.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/main/traex/traex-turn-cancel.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 866b66cd-8b52-40c8-98d5-feffaf2c8fcf
Commits

Reviewing files that changed from the base of the PR and between 39bb352 and dfb018f.

Files selected for processing: 9

  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-adopted-import.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-flow.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-history.ts
  • src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-adopted-import.test.ts
  • src/main/runtime/agent-session/naming/structured-chat-naming-runtime.test.ts
  • src/main/runtime/agent-session/naming/structured-chat-naming-runtime.ts
  • src/main/traex/__fixtures__/traex-scripted-app-server.mjs
  • src/main/traex/traex-session-controls.test.ts
  • src/main/traex/traex-turn-cancel.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment thread src/main/traex/traex-turn-cancel.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4ddd532-9c01-4e52-93f8-40186e1850c2
Commits

Reviewing files that changed from the base of the PR and between dfb018f and ce432aa.

Files selected for processing: 10

  • src/main/native-chat/agent-session-journal/journal-domain-context-replacement.ts
  • src/main/native-chat/agent-session-journal/journal-domain-context-state.ts
  • src/main/native-chat/agent-session-journal/journal-sql-rewind-command.ts
  • src/main/native-chat/agent-session-journal/journal-writer-command.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-adopted-import.ts
  • src/main/native-chat/agent-session-wire/acquisition/structured-agent-session-attach-history.ts
  • src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-adopted-import.test.ts
  • src/main/traex/__fixtures__/traex-scripted-app-server.mjs
  • src/main/traex/traex-session-controls.test.ts
  • src/main/traex/traex-turn-cancel.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment thread src/main/traex/traex-turn-cancel.ts Resolved
@Aues6uen11Z

Copy link
Copy Markdown
Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Reviews resumed and review finished.

@Aues6uen11Z

Copy link
Copy Markdown
Author

Hi @AmethystLiang , I really enjoy using Orca. TRAE CLI is used frequently by both me and many people at my company, and I’d love to see it better supported in Orca.

Would you mind taking a look at this PR when you have a chance? It adds native Chat UI support for TRAE CLI and has been tested on macOS and with a paired Linux server. All checks are passing, and I’m happy to address any feedback promptly.

Co-authored-by: TRAE CLI <traecli@bytedance.com>

This branch has not been deployed

No deployments
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.

[Feature]: Import or attach an existing Trae CLI session to an Orca-native agent

2 participants