mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 02:17:31 +00:00
* fix(agents): paired-host agent tabs use the host's launch settings Agent tabs opened on a paired host were replacing that host's permissions and Arguments with the desktop's settings. Let the host plan fresh launches, carry the user's choices separately, and preserve existing prepared launches when an older host cannot express them. Action Arguments replace configured Arguments while inheriting the host's permission settings; resumed sessions keep their recorded recipe. * fix(agents): paired-host agent tabs use the host's launch settings Preserve per-launch permissions on older paired hosts by compiling picks they cannot apply from their own settings. Keep authored Arguments separate from saved model defaults so a command's pinned model wins. Use the host's reported shell and execution platform for argument quoting, and remove unused prompt-delivery wrappers. * fix(agents): paired-host agent tabs use the host's launch settings Replace recognized permission flags from older paired hosts when a launch picks another permission, while preserving unrelated Arguments and ambiguous prepared launches. Keep multiline drafts working on Command Prompt hosts and omit chat-only permissions from terminal requests. * fix(agents): paired-host agent tabs use the host's launch settings Preserve per-launch permission choices that suppress the paired host's Full access flag even when the choice emits no flag itself. Compile these choices from the host snapshot when older launch preferences cannot carry them, while keeping unsupported OpenCode terminal permissions filtered out. * test: merge duplicate imports in paired launch options test * test: drop type assertions in paired launch options test * chore: lower focus-read ratchet baseline after removing creation wrappers * fix(agents): paired-host agent tabs use the host's launch settings Keep accepted inline fork drafts delivered when their mirrored tab is unavailable, and cancel launches whose pairing changes during negotiation. Keep action Arguments metadata on the tab route so injected workspace launch callbacks retain their contract. Update consumer fixtures to run lazy compatibility preparation and verify the final launch inputs and cancellation boundary. * fix(agents): paired-host agent tabs use the host's launch settings Keep pairing changes during legacy launch preparation silent and preserve the prompt for retry. Make picker tests exercise structured model picks on modern hosts while retaining prepared-command coverage for older hosts. * fix(agents): paired-host agent tabs use the host's launch settings A permission pick on an older paired host could turn desktop-configured Arguments into a launch override, including the desktop's model. Keep settings-seeded text out of the paired picker request so the host snapshot supplies defaults, while preserving explicitly edited launch Arguments. * fix(agents): paired-host agent tabs use the host's launch settings Keep permission-control choices separate from Arguments the user edited. Fresh paired terminal launches now share that ownership projection in the new-tab picker and continuation dialog, so a control change preserves the host's executable and environment settings. Explicit Arguments edits, including clearing the field, keep their existing launch behavior. Cover old-host and modern requests, explicit terminal/chat edits, and the continuation Start handler. Workspace creation keeps its existing path. * fix(agents): paired-host agent tabs use the host's launch settings Older paired hosts could inherit the desktop's model and permission defaults when the launch picker was configured or reopened. Read picker defaults and prepared launch recipes from the executing host, and compile edited Arguments using its settings. Preserve explicit empty edits, narrower permissions and draft prompts. Keep inherited choices neutral while host settings are unavailable, retaining the existing compatibility launch when no usable host recipe exists. * chore: merge duplicate type import and drop dead test branch * fix(agents): paired-host agent tabs use the host's launch settings Actions with explicit permission choices could unnecessarily read host settings and fall back to desktop preparation when those reads failed. Keep representable action Arguments on the host's authoritative launch path, and read inherited permissions only when the action needs them. Cover an explicit empty Arguments override and Ask with unavailable settings, preserving the host executable and environment without a permission bypass. * fix(agents): paired-host agent tabs use the host's launch settings Supply the paired host's default agent in the shortcut test instead of assuming the desktop's default applies. Keep a conflicting desktop default so the shortcut continues to verify the paired host owns its selection.
150 lines
6.2 KiB
JavaScript
150 lines
6.2 KiB
JavaScript
import { beforeAll, describe, expect, it } from 'vitest'
|
|
import { classifyPrJobs } from './pr-code-change-scope.mjs'
|
|
import { selectPrE2eSpecs } from './pr-e2e-source-routing.mjs'
|
|
import {
|
|
buildUnitDependencyGraph,
|
|
collectUnitDependencyGraph,
|
|
unitConsumers
|
|
} from '../../ci/unit-selection/dependency-graph/ci-unit-dependency-graph.mjs'
|
|
import {
|
|
CROSS_VERSION_WIRE_DIR,
|
|
discoverUnitFiles
|
|
} from '../../ci/unit-selection/dependency-graph/ci-unit-files.mjs'
|
|
|
|
const harness = 'src/renderer/src/runtime/web-session-tabs-sync-test-harness.ts'
|
|
const structuredSessionHarness =
|
|
'src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx'
|
|
|
|
const unitHarnesses = [
|
|
harness,
|
|
structuredSessionHarness,
|
|
'src/renderer/src/store/slices/editor-slice-test-harness.ts',
|
|
'src/renderer/src/store/slices/browser-slice-test-harness.ts',
|
|
'src/renderer/src/runtime/web-runtime-session-test-harness.ts',
|
|
'src/renderer/src/runtime/sync-runtime-graph-test-harness.ts'
|
|
]
|
|
const supportBridges = new Set([
|
|
// Launch request suites' store rig; it takes the terminal harness's workspace layout.
|
|
'src/renderer/src/runtime/web-runtime-agent-launch-options.test-fixture.ts',
|
|
'src/renderer/src/runtime/web-runtime-browser-creation-placement-test-rig.ts',
|
|
'src/renderer/src/components/editor/model-lifetime/retention/editor-model-lifetime-fixture.ts',
|
|
// Autosave suites' store rig; it takes the editor harness's tab-layout maps.
|
|
'src/renderer/src/components/editor/autosave/editor-autosave-controller-test-fixture.ts',
|
|
// Closed-saving-view save suites' rig; it builds on the autosave rig above.
|
|
'src/renderer/src/components/editor/save/queue/editor-save-closed-view.test-fixture.ts',
|
|
// Browser suites' store with main drawing their tabs; it takes the browser harness's store.
|
|
'src/renderer/src/store/slices/browser-slice-drawn-from-main.test-fixture.ts'
|
|
])
|
|
|
|
function productConsumers(file, graph, unitFiles) {
|
|
return [...unitConsumers([file], graph.reverse)].filter(
|
|
(consumer) =>
|
|
consumer !== file &&
|
|
!unitFiles.has(consumer) &&
|
|
!(consumer.startsWith(CROSS_VERSION_WIRE_DIR) && consumer.endsWith('.unit.test.ts')) &&
|
|
!supportBridges.has(consumer)
|
|
)
|
|
}
|
|
|
|
describe('unit support routing', () => {
|
|
it.each(unitHarnesses)(
|
|
'keeps unit checks and lint while excluding packaging for %s',
|
|
(unitHarness) => {
|
|
const result = classifyPrJobs([unitHarness])
|
|
expect(result.should_run).toBe(true)
|
|
expect(result.static_analysis).toBe(true)
|
|
expect(result.typecheck).toBe(true)
|
|
expect(result.test).toBe(true)
|
|
expect(result.package).toBe(false)
|
|
expect(result.package_windows).toBe(false)
|
|
}
|
|
)
|
|
|
|
it.each(unitHarnesses)(
|
|
'retains packaging for unknown helpers and mixed product changes with %s',
|
|
(unitHarness) => {
|
|
for (const file of [
|
|
unitHarness.replace(/\.(tsx?)$/, '-next.$1'),
|
|
'src/renderer/src/runtime/web-session-tabs-sync-next-test-harness.ts',
|
|
'src/renderer/src/runtime/web-session-tabs-sync/snapshot-api.ts',
|
|
'src/renderer/src/components/native-chat/NativeChatStructuredSession.next-test-harness.tsx',
|
|
'src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx',
|
|
'src/main/providers/windows-conpty-wide-char-duplication.node-pty.test.ts',
|
|
'src/main/browser/client-pages/renderer/browser-client-page-renderer-lifecycle.electron.test.ts'
|
|
]) {
|
|
const result = classifyPrJobs([unitHarness, file])
|
|
expect(result.should_run, file).toBe(true)
|
|
expect(result.test, file).toBe(true)
|
|
expect(result.package, file).toBe(
|
|
file !== 'src/main/providers/windows-conpty-wide-char-duplication.node-pty.test.ts'
|
|
)
|
|
expect(result.package_windows, file).toBe(true)
|
|
}
|
|
}
|
|
)
|
|
|
|
it.each(unitHarnesses)('does not select product E2E for %s', (unitHarness) => {
|
|
expect(selectPrE2eSpecs([unitHarness])).toEqual([])
|
|
})
|
|
|
|
it('retains E2E selection for unknown helpers, product changes and selected specs', () => {
|
|
const spec = 'tests/e2e/paired-client-hosted-browser-restart-survival.spec.ts'
|
|
for (const file of [
|
|
'src/renderer/src/runtime/web-session-tabs-sync-next-test-harness.ts',
|
|
'src/renderer/src/runtime/web-session-tabs-sync/snapshot-api.ts',
|
|
spec
|
|
]) {
|
|
expect(selectPrE2eSpecs([harness, file]), file).toContain(spec)
|
|
}
|
|
})
|
|
})
|
|
|
|
describe('unit support import ownership', () => {
|
|
let graph
|
|
let unitFiles
|
|
beforeAll(() => {
|
|
graph = collectUnitDependencyGraph()
|
|
unitFiles = new Set(discoverUnitFiles())
|
|
}, 60_000)
|
|
|
|
it.each(unitHarnesses)('rejects any product consumer of %s', (unitHarness) => {
|
|
expect(graph.files.has(unitHarness)).toBe(true)
|
|
expect(
|
|
[...unitConsumers([unitHarness], graph.reverse)].some((file) => unitFiles.has(file))
|
|
).toBe(true)
|
|
expect(productConsumers(unitHarness, graph, unitFiles)).toEqual([])
|
|
})
|
|
|
|
it.each([
|
|
"import '@/runtime/web-session-tabs-sync-test-harness'",
|
|
"export * from '@/runtime/web-session-tabs-sync-test-harness'",
|
|
"import('@/runtime/web-session-tabs-sync-test-harness')",
|
|
"import type { Fixture } from '@/runtime/web-session-tabs-sync-test-harness'"
|
|
])('detects a product importer using %s', (source) => {
|
|
const importer = 'src/renderer/src/runtime/product.ts'
|
|
const test = 'src/renderer/src/runtime/ownership.test.ts'
|
|
const synthetic = buildUnitDependencyGraph(
|
|
new Map([
|
|
[harness, 'export const value = 1'],
|
|
[importer, source],
|
|
[test, "import './web-session-tabs-sync-test-harness'"]
|
|
])
|
|
)
|
|
expect(productConsumers(harness, synthetic, new Set([test]))).toEqual([importer])
|
|
})
|
|
|
|
it('rejects product consumers reached through an audited support bridge', () => {
|
|
const bridge =
|
|
'src/renderer/src/components/editor/model-lifetime/retention/editor-model-lifetime-fixture.ts'
|
|
const importer = 'src/renderer/src/components/editor/product.ts'
|
|
const synthetic = buildUnitDependencyGraph(
|
|
new Map([
|
|
[harness, 'export const value = 1'],
|
|
[bridge, "import '@/runtime/web-session-tabs-sync-test-harness'"],
|
|
[importer, "import './model-lifetime/retention/editor-model-lifetime-fixture'"]
|
|
])
|
|
)
|
|
expect(productConsumers(harness, synthetic, new Set())).toEqual([importer])
|
|
})
|
|
})
|