Repository navigation
feat(agents): complete prime-agent title profiles and headless commit env - #13707
jitsmaster wants to merge 4 commits into
Conversation
… env prime-agent support on main covers launch, detection, extensions, and session scanning, but two surfaces were left out: - SYNTHETIC_AGENT_TITLE_PROFILES had no prime-agent entry, so Prime Agent panes rendered no working/idle status titles and missed the pi-compatible title identity group. - prepareShellConfigDirEnv ignored prime-agent, so headless commit-message and SourceControl AI runs never hydrated PRIME_AGENT_CODING_AGENT_DIR (and never stripped a stale ORCA_PRIME_AGENT_SOURCE_AGENT_DIR overlay). Adds the title profile (working/idle labels + pi-compatible group), the PRIME_AGENT_CODING_AGENT_DIR / ORCA_PRIME_AGENT_SOURCE_AGENT_DIR env handling, and tests for both.
📝 WalkthroughWalkthroughThe change adds Prime Agent environment handling for configuration directory hydration and inherited source-directory precedence. It also adds a Prime Agent synthetic title profile with working, permission, and idle labels. Tests cover shell-based directory expansion, overlay precedence, terminal titles, and hook-driven working-state updates. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a7be3bfb-cefa-451e-869f-a31e11c0df05
📒 Files selected for processing (4)
src/main/text-generation/commit-message-agent-environment.test.tssrc/main/text-generation/commit-message-agent-environment.tssrc/shared/synthetic-agent-title.test.tssrc/shared/synthetic-agent-title.ts
CodeRabbit: makeHome() cleared the OpenCode and Pi overlay vars but not ORCA_PRIME_AGENT_SOURCE_AGENT_DIR, so the shell-hydration test could resolve an inherited overlay instead of the .zshrc value.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 99364bc9-4266-49aa-8b4d-0b2283522a64
📒 Files selected for processing (2)
src/main/text-generation/commit-message-agent-environment.tssrc/shared/synthetic-agent-title.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/shared/synthetic-agent-title.ts
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/shared/synthetic-agent-title.test.ts (1)
44-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the
pi-compatibleidentity group.This test name claims to verify group membership, but it only checks labels and hook behavior. Add an assertion for
getSyntheticAgentTitleProfile('prime-agent')?.titleIdentityGroup; otherwise the identity-group contract can regress without failing this test.Proposed test assertion
import { getSyntheticAgentTerminalTitle, + getSyntheticAgentTitleProfile, shouldDriveSyntheticAgentTitleFromHook } from './synthetic-agent-title' it('provides Prime Agent titles within the pi-compatible identity group', () => { + expect(getSyntheticAgentTitleProfile('prime-agent')?.titleIdentityGroup).toBe( + 'pi-compatible' + ) expect(getSyntheticAgentTerminalTitle('prime-agent', 'done')).toBe('Prime Agent ready')
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 06f49167-2f8f-4135-aeb7-19821b52f086
📒 Files selected for processing (4)
src/main/text-generation/commit-message-agent-environment.test.tssrc/main/text-generation/commit-message-agent-environment.tssrc/shared/synthetic-agent-title.test.tssrc/shared/synthetic-agent-title.ts
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6f1a3e6a-d5d3-4d89-abcd-262b18762aa8
📒 Files selected for processing (4)
src/main/text-generation/commit-message-agent-environment.test.tssrc/main/text-generation/commit-message-agent-environment.tssrc/shared/synthetic-agent-title.test.tssrc/shared/synthetic-agent-title.ts
|
|
||
| it('provides Prime Agent titles within the pi-compatible identity group', () => { | ||
| expect(getSyntheticAgentTerminalTitle('prime-agent', 'done')).toBe('Prime Agent ready') | ||
| expect(getSyntheticAgentTerminalTitle('prime-agent', 'waiting')).toBe( | ||
| 'Prime Agent - action required' | ||
| ) | ||
| expect(shouldDriveSyntheticAgentTitleFromHook('prime-agent', 'working')).toBe(true) | ||
| }) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert the identity group directly.
The test name claims that Prime Agent belongs to pi-compatible, but the assertions cover only titles and hook behavior. If titleIdentityGroup changes or is removed, this test still passes. Assert getSyntheticAgentTitleProfile('prime-agent')?.titleIdentityGroup equals 'pi-compatible'.
Summary
Refs #12892.
Adds support for Prime Agent (github.com/PrimeIntellect-ai/prime-agent), the recently popular self-improving coding agent built as a fork of Pi. Most of the prime-agent integration is already on main (launch/detection config, pi-compatible extension machinery, session scanning, relay plumbing); this PR completes the two remaining surfaces so Prime Agent is fully first-class in Orca:
Synthetic title profiles (
src/shared/synthetic-agent-title.ts)Prime Agent panes now render working/idle status titles ("Prime Agent ready", "Prime Agent - action required") and join the
pi-compatibletitle identity group, matching Pi and OMP. Previously a prime-agent pane had no synthesized title and missed pi-compatible title ownership.Headless commit env (
src/main/text-generation/commit-message-agent-environment.ts)prepareShellConfigDirEnvnow handlesprime-agent: it hydratesPRIME_AGENT_CODING_AGENT_DIR(from shell startup files or inherited env) and strips a staleORCA_PRIME_AGENT_SOURCE_AGENT_DIRoverlay, mirroring the Pi/OMP handling. Previously a headless commit-message or SourceControl AI run ignored prime-agent entirely.Screenshots
No visual change. This adds a synthetic title label set for Prime Agent panes, rendered through the existing terminal title bar path shared with Pi/OMP; no layout or rendering behavior changes.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildNotes on the above:
pnpm lint(oxlint native + type-aware audits, reliability gates, localization checks) andpnpm typecheckpass locally.pnpm test: the 21 tests in the touched suites (src/shared/synthetic-agent-title.test.ts,src/main/text-generation/commit-message-agent-environment.test.ts) all pass locally; the full ~50k-test suite runs in the PR CI matrix (node 24/26, 16 shards).pnpm build: the desktop + native build runs in the PR CIpackagejob on this fork PR; no build inputs were changed by this PR (source-only edits to two.tsfiles and their tests).synthetic-agent-title.test.tscovers title + identity-group behavior forprime-agent;commit-message-agent-environment.test.tscovers shell-startup hydration and overlay-restore forprime-agent, mirroring the existing Pi cases.AI Review Report
Reviewed with an AI coding agent (CodeRabbit). The review checked: title-profile lookup and
pi-compatibleidentity-group ownership forprime-agentvs Pi/OMP; env hydration precedence (inherited env vs shell startup files vsORCA_*_SOURCE_*overlay); and overlay-restore behavior for nested Orca launches. CodeRabbit flagged that the shell-hydration test could inherit a staleORCA_PRIME_AGENT_SOURCE_AGENT_DIRfrom the test process; fixed in b2cebaa by clearing the overlay in the sharedmakeHome()setup. A follow-up review flagged the docstring scope wording; corrected in 4d0bc72. No remaining actionable findings.Cross-platform confirmation: the change is platform-neutral. The touched code is shared TypeScript that only reads/writes environment variables and title-label strings; no shortcuts, labels, paths, shell scripts, or Electron-specific APIs differ by platform. Shell-startup hydration reuses the existing
readShellStartupEnvVarpath already exercised on macOS, Linux, and Windows.Security Audit
Reviewed for input handling, command execution, path handling, auth, secrets, dependency, and IPC risks. This PR adds no new input surfaces, command execution, dependencies, auth flows, or IPC channels. The only runtime effect is env hydration for a headless commit-message child process: values come from the user's own shell startup files or inherited env (the same trusted sources Pi/OMP already use), and overlay stripping only removes an Orca-owned variable. No secrets are logged or transmitted; the pre-existing
console.errorinprepareLocalCommitMessageAgentEnvlogs only a static message. No follow-up needed.Notes
PRIME_AGENT_CODING_AGENT_DIRis hydrated only when resolvable; runs without a shell-startup export or inherited value fall back to the agent's default config lookup, matching Pi behavior.pi-compatibleidentity group, so title ownership and session scanning treat Prime Agent and Pi panes consistently; the group remains per-agent if a future Pi-family agent needs its own.