You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(native-chat): add TRAE CLI chat support - #43564
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.
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
Native Chat
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
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
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
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/compactwith a visible context-compaction divider,/recap, and/goalwith goal status and controls.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
Native Chat
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-projectpnpm tcpassed.Earlier full local
pnpm lint: 48 checks passed. Fullpnpm buildpassed, 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
Notes
Requires TRAE CLI 0.214.1 or newer.
Two documented entries in
config/main-blocking-helper-baseline.txtare 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