fix(automations): send managed SSH host automations to its Orca server (#39160)

* fix(automations): send managed SSH host automations to its Orca server

A managed SSH host's automations live on its Orca server (#24863), but the
create dialog, CLI and mobile still saved desktop copies that never ran.

- Desktop dialog: the host's desktop SSH entry is no longer offered; its
  key resolves to the host's server entry.
- CLI create routes to the server by project id, or asks to move the
  project there first; mobile hands the create to the server's editor.
- Existing desktop copies skip with "{host} now runs automations on its
  Orca server" and offer "Move to {host}" through the editor's move save.

STA-13422

* fix(automations): address review on managed SSH host routing

- CLI: refuse a desktop copy when the desktop reports a managed host this
  CLI holds no server for; pass the workspace by id to the server; check
  field support on the server too.
- Main: the skip follows the owner selector, so local rows pinned to a
  managed host's workspace skip too.
- Editor: a destination host whose project table loads after open keeps
  the chosen project.

* fix(automations): refuse new desktop rows on a managed SSH host and move leftovers

Per review and the owner's follow-up:
- The desktop's automation create/update refuses a row on a managed SSH
  host ("Move this project to {host} first."), covering CLI, mobile, raw
  RPC and older clients.
- Existing desktop copies move to the host's Orca server on startup, on
  managed connect and on their due tick: created there keyed by the
  desktop row id, then removed here. A server without the project leaves
  the skip and the Move button.
- Mobile drops the Save-time hand-off; its picker no longer offers a
  managed host's desktop SSH setup.
- CLI routes only for a local client, using that client's profile.

* fix(automations): drop the automatic leftover move

A managed host's leftover desktop rows keep the skip reason and the
Move to {host} button; moving them automatically will extend the existing
managed-host migration in a follow-up.

* fix(cli): resolve an automation's SSH destination from the repo's routing id

* chore: prune the repo host read baseline for the CLI destination

* fix(automations): migrate a leftover automation in one click

The detail banner's Migrate runs the editor's own move-to-server save without
opening the dialog. Leftovers show Needs migration instead of Enabled, and
their skipped runs read Needs migration to {host}.

* fix(automations): wrap the Needs migration status instead of cutting it off

* fix(automations): name a leftover's project from its migrated copy

* fix(automations): save a host move against the project table loaded after the editor opened

Migrate loads the server's repo table first, but the save transaction read the
destination captured before that load, so the first click on a cold catalog was
refused. Save now reads the same derived destination the form already shows.

* fix(automations): drop the leftover project-name fallback

The global id lookup could name another host's project. Scoping it to the
leftover's server is not worth the code for a display-only label, so a leftover
whose project moved shows Unknown project again.

* fix(automations): name a leftover's project from its migrated copy

A managed SSH leftover's project always moves to the host's Orca server with
the same id, so only those rows fall back to the id lookup; any other row with a
missing project stays Unknown project.
This commit is contained in:
Jinwoo Hong
2026-11-07 01:47:06 -05:00
committed by GitHub
parent 7fdb80ac21
commit 0e36bfa4a7
58 changed files with 677 additions and 98 deletions
+9 -10
View File
@@ -2,19 +2,16 @@
# This is a RATCHET: counts may only go DOWN. Resolve the host instead (see fix text).
# A lower bound: destructured and differently named rows are not counted.
# Prune after a fix: pnpm check:repo-host-read-ratchet --prune
1 src/cli/automation-destination.ts
1 src/main/workspaces/catalog/folder-repo-git-conversion.ts
1 src/main/github/account-binding-required-host.ts
3 src/main/ipc/ephemeral-vm-recipe-context.ts
2 src/main/ipc/filesystem/filesystem-source-control-ai-targets.ts
1 src/main/ipc/folder-repo-git-upgrade.ts
1 src/main/ipc/local-worktree-runtime-options.ts
4 src/main/ipc/repos/local-repo-registration.ts
1 src/main/ipc/repos/nested-repo-import-handler.ts
2 src/main/ipc/source-control/github-repo-routing.ts
1 src/main/ipc/source-control/github-work-item-args.ts
1 src/main/ipc/source-control/gitlab-repo-access.ts
1 src/main/ipc/local-worktree-runtime-options.ts
1 src/main/ipc/worktrees/removal/registered-worktree-root-owner.ts
4 src/main/ipc/repos/local-repo-registration.ts
1 src/main/ipc/repos/nested-repo-import-handler.ts
2 src/main/ipc/workspace-cleanup/workspace-cleanup-candidate.ts
1 src/main/ipc/workspace-cleanup/workspace-cleanup-disconnected-ssh.ts
1 src/main/ipc/worktrees-test-metadata-pruning-store.ts
@@ -24,6 +21,7 @@
2 src/main/ipc/worktrees/removal/nested-worktree-removal.ts
2 src/main/ipc/worktrees/removal/register-worktree-forget-handlers.ts
1 src/main/ipc/worktrees/removal/register-worktree-removal-handlers.ts
1 src/main/ipc/worktrees/removal/registered-worktree-root-owner.ts
1 src/main/ipc/worktrees/repo-host-ownership.ts
2 src/main/orca-profiles/profile-project-transfer-payload.ts
1 src/main/orca-profiles/profile-project-worktree-identity.ts
@@ -36,16 +34,17 @@
1 src/main/ports/ssh-advertised-url-enrichment.ts
2 src/main/ports/workspace-port-ownership.ts
5 src/main/project-groups/folder-workspace-path-status.ts
1 src/main/workspaces/catalog/provisioned-root-ssh-adoption.ts
2 src/main/workspaces/catalog/repo-git-username-enrichment.ts
1 src/main/runtime/rpc/methods/agent-launch/agent-launch-worktree-creation.ts
1 src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts
3 src/main/runtime/runtime-reference-agents.ts
1 src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts
1 src/main/runtime/workspaces/catalog/runtime-worktree-selection.ts
1 src/main/ssh/targets/ssh-target-orcad-claims.ts
1 src/main/workspaces/space-analysis/workspace-space-worktree-row.ts
1 src/main/workspaces/catalog/folder-repo-git-conversion.ts
1 src/main/workspaces/catalog/provisioned-root-ssh-adoption.ts
2 src/main/workspaces/catalog/repo-git-username-enrichment.ts
1 src/main/workspaces/creation/worktree-create-base-prefetch.ts
2 src/main/workspaces/removal/retirement/worktree-name-retirement.ts
1 src/main/workspaces/space-analysis/workspace-space-worktree-row.ts
1 src/shared/endpoint-catalog-adoption.ts
1 src/shared/folder-workspaces/folder-workspace-execution-host.ts
1 src/shared/github/github-cache-key.ts
@@ -146,7 +146,8 @@ export const sshInventorySchema = z.object({
z.object({
id: z.string(),
label: z.string(),
generation: z.number().int().positive().optional()
generation: z.number().int().positive().optional(),
managedServer: z.literal(true).optional().catch(undefined)
})
)
})
@@ -93,6 +93,12 @@ const COPY: Record<
translate('automations.runFailures.wslMoveInProgress', EN.wslMoveInProgress),
wslMoveOwnedByHost: () =>
translate('automations.runFailures.wslMoveOwnedByHost', EN.wslMoveOwnedByHost),
managedHostServer: (params) => {
const host = params?.host
return typeof host === 'string'
? translate('automations.runFailures.managedHostServer', EN.managedHostServer, { host })
: null
},
missedGraceWindow: () =>
translate('automations.runFailures.missedGraceWindow', EN.missedGraceWindow),
targetMissing: () => translate('automations.runFailures.targetMissing', EN.targetMissing),
@@ -57,8 +57,17 @@ export async function loadAutomationTargets(client: RpcClient, limit = 200) {
})
const repoLookup = createRepoRowExecutionHostLookup(repoRows)
const projectRows = automationProjectsRead.interpret(projects).projects
const sshTargets = automationSshTargetsRead.interpret(ssh).targets
return {
setups: automationSetupsRead.interpret(setups).setups.flatMap((setup) => {
// A managed SSH host's automations live on its Orca server; pick that host instead.
const host = parseExecutionHostId(setup.hostId)
if (
host?.kind === 'ssh' &&
sshTargets.some((target) => target.id === host.targetId && target.managedServer)
) {
return []
}
const repo = repoRows.find(
(repo) =>
repo.id === setup.repoId &&
@@ -94,7 +103,7 @@ export async function loadAutomationTargets(client: RpcClient, limit = 200) {
truncated: workspaceReply.truncated,
hostScope: workspaceReply.hostScope
},
sshTargets: automationSshTargetsRead.interpret(ssh).targets
sshTargets
}
}
export type AutomationTargets = Awaited<ReturnType<typeof loadAutomationTargets>>
+2 -1
View File
@@ -53,7 +53,8 @@
"workspaceHostAmbiguous": "The automation workspace spans more than one host, so Orca cannot tell which one to run it on.",
"wslDistroStopped": "The WSL distro {{distro}} is stopped, so this scheduled run did not start it. Start the distro or use Run now; later runs go ahead while it runs.",
"wslMoveInProgress": "This automation's project is moving to its WSL host, so Orca skipped this run. Runs resume when the move finishes.",
"wslMoveOwnedByHost": "This automation's project now runs on its WSL host, which runs this automation there. Orca no longer runs this local copy."
"wslMoveOwnedByHost": "This automation's project now runs on its WSL host, which runs this automation there. Orca no longer runs this local copy.",
"managedHostServer": "Needs migration to {{host}}"
}
},
"chat": {
+1
View File
@@ -4075,6 +4075,7 @@
"noRunnableHost": "Dieser Automatisierung fehlt ein Host zur Ausführung.",
"wslMoveInProgress": "Das Projekt dieser Automatisierung wird auf seinen WSL-Host verschoben. Deshalb hat Orca diese Ausführung übersprungen. Die Ausführungen werden nach Abschluss des Verschiebens fortgesetzt.",
"wslMoveOwnedByHost": "Das Projekt dieser Automatisierung läuft jetzt auf seinem WSL-Host, der die Automatisierung dort ausführt. Orca führt diese lokale Kopie nicht mehr aus.",
"managedHostServer": "Migration zu {{host}} erforderlich",
"missedGraceWindow": "Bei der nächsten Prüfung durch Orca war die Nachholfrist für diese verpasste Ausführung bereits abgelaufen.",
"targetMissing": "Der Host der Automatisierung ist nicht mehr registriert. Daher gibt es für diese Automatisierung keinen Ausführungsort.",
"targetReplaced": "Der Host der Automatisierung wurde entfernt und erneut registriert. Daher muss diese Automatisierung vor der Ausführung erneut zugeordnet werden.",
+1
View File
@@ -4649,6 +4649,7 @@
"noRunnableHost": "This automation has no host to run on.",
"wslMoveInProgress": "This automation's project is moving to its WSL host, so Orca skipped this run. Runs resume when the move finishes.",
"wslMoveOwnedByHost": "This automation's project now runs on its WSL host, which runs this automation there. Orca no longer runs this local copy.",
"managedHostServer": "Needs migration to {{host}}",
"missedGraceWindow": "This run was past its missed-run grace window when Orca next checked.",
"targetMissing": "The automation host is no longer registered, so this automation has nowhere to run.",
"targetReplaced": "The automation host was removed and re-registered, so this automation must be re-adopted before it can run.",
+1
View File
@@ -4173,6 +4173,7 @@
"noRunnableHost": "Esta automatización no tiene host donde ejecutarse.",
"wslMoveInProgress": "El proyecto de esta automatización se está moviendo a su host WSL, por lo que Orca omitió esta ejecución. Las ejecuciones se reanudarán cuando termine el traslado.",
"wslMoveOwnedByHost": "El proyecto de esta automatización ahora se ejecuta en su host WSL, que ejecuta allí esta automatización. Orca ya no ejecuta esta copia local.",
"managedHostServer": "Requiere migración a {{host}}",
"missedGraceWindow": "Cuando Orca volvió a comprobarlo, ya había vencido el período de gracia para recuperar esta ejecución omitida.",
"targetMissing": "El host de la automatización ya no está registrado, por lo que esta automatización no tiene dónde ejecutarse.",
"targetReplaced": "El host de la automatización se eliminó y se volvió a registrar, por lo que hay que volver a vincular esta automatización antes de poder ejecutarla.",
+1
View File
@@ -4173,6 +4173,7 @@
"noRunnableHost": "Cette automatisation n’a pas d’hôte sur lequel s’exécuter.",
"wslMoveInProgress": "Le projet de cette automatisation est en cours de déplacement vers son hôte WSL. Orca a donc ignoré cette exécution. Les exécutions reprendront à la fin du déplacement.",
"wslMoveOwnedByHost": "Le projet de cette automatisation s’exécute désormais sur son hôte WSL, qui y exécute cette automatisation. Orca n’exécute plus cette copie locale.",
"managedHostServer": "Migration vers {{host}} requise",
"missedGraceWindow": "Lors de la vérification suivante par Orca, la marge de rattrapage de cette exécution manquée était déjà dépassée.",
"targetMissing": "L’hôte de l’automatisation n’est plus enregistré. Cette automatisation n’a donc plus d’hôte sur lequel s’exécuter.",
"targetReplaced": "L’hôte de l’automatisation a été supprimé puis réenregistré. Cette automatisation doit donc être rattachée à nouveau avant de pouvoir s’exécuter.",
+1
View File
@@ -4071,6 +4071,7 @@
"noRunnableHost": "このオートメーションには実行するホストがありません。",
"wslMoveInProgress": "このオートメーションのプロジェクトを WSL ホストへ移動中のため、Orca は今回の実行をスキップしました。移動が完了すると実行が再開されます。",
"wslMoveOwnedByHost": "このオートメーションのプロジェクトは現在 WSL ホスト上で動作しており、オートメーションもそこで実行されます。Orca はこのローカルコピーを実行しなくなりました。",
"managedHostServer": "{{host}} への移行が必要",
"missedGraceWindow": "Orca が次に確認した時点で、この実行は実行漏れの猶予時間を過ぎていました。",
"targetMissing": "オートメーションのホストは登録されていないため、このオートメーションを実行する場所がありません。",
"targetReplaced": "オートメーションのホストが削除され、再登録されたため、実行するにはこのオートメーションを再度関連付ける必要があります。",
+1
View File
@@ -4071,6 +4071,7 @@
"noRunnableHost": "이 자동화에는 실행할 호스트가 없습니다.",
"wslMoveInProgress": "이 자동화의 프로젝트를 WSL 호스트로 옮기는 중이어서 Orca가 이번 실행을 건너뛰었습니다. 이동이 끝나면 실행이 재개됩니다.",
"wslMoveOwnedByHost": "이 자동화의 프로젝트는 이제 WSL 호스트에서 실행되며, 해당 호스트가 그곳에서 이 자동화를 실행합니다. Orca는 더 이상 이 로컬 사본을 실행하지 않습니다.",
"managedHostServer": "{{host}}(으)로 마이그레이션 필요",
"missedGraceWindow": "Orca가 다시 확인했을 때 이 실행을 보충할 수 있는 유예 시간이 이미 지나 있었습니다.",
"targetMissing": "자동화 호스트가 더 이상 등록되어 있지 않아 이 자동화를 실행할 곳이 없습니다.",
"targetReplaced": "자동화 호스트가 제거된 후 다시 등록되었으므로, 이 자동화를 실행하려면 다시 연결해야 합니다.",
+1
View File
@@ -4173,6 +4173,7 @@
"noRunnableHost": "Esta automação não tem host onde ser executada.",
"wslMoveInProgress": "O projeto desta automação está sendo movido para seu host WSL, por isso o Orca ignorou esta execução. As execuções serão retomadas quando a movimentação terminar.",
"wslMoveOwnedByHost": "O projeto desta automação agora é executado em seu host WSL, que também executa esta automação. O Orca não executa mais esta cópia local.",
"managedHostServer": "Requer migração para {{host}}",
"missedGraceWindow": "Quando o Orca verificou novamente, o período de tolerância para recuperar esta execução perdida já havia expirado.",
"targetMissing": "O host da automação não está mais registrado, então esta automação não tem onde ser executada.",
"targetReplaced": "O host da automação foi removido e registrado novamente, então esta automação precisa ser vinculada novamente antes de poder ser executada.",
+1
View File
@@ -4271,6 +4271,7 @@
"noRunnableHost": "У этой автоматизации нет сервера выполнения.",
"wslMoveInProgress": "Проект этой автоматизации переносится на свой сервер WSL, поэтому Orca пришлось пропустить этот запуск. Запуски возобновятся после завершения переноса.",
"wslMoveOwnedByHost": "Проект этой автоматизации теперь работает на своём сервере WSL, который выполняет эту автоматизацию там. Orca больше не запускает эту локальную копию.",
"managedHostServer": "Требуется перенос на {{host}}",
"missedGraceWindow": "При следующей проверке Orca допустимая задержка для этого пропущенного запуска уже была превышена.",
"targetMissing": "Сервер автоматизации больше не зарегистрирован, поэтому эту автоматизацию негде запускать.",
"targetReplaced": "Сервер автоматизации был удалён и зарегистрирован заново, поэтому перед запуском эту автоматизацию нужно повторно привязать.",
+1
View File
@@ -4075,6 +4075,7 @@
"noRunnableHost": "Bu otomasyonun çalışacağı bir sunucu yok.",
"wslMoveInProgress": "Bu otomasyonun projesi WSL ana makinesine taşınıyor. Bu nedenle Orca bu çalıştırmayı atladı. Taşıma tamamlandığında çalıştırmalar devam edecek.",
"wslMoveOwnedByHost": "Bu otomasyonun projesi artık WSL ana makinesinde çalışıyor ve bu otomasyon da orada ana makine tarafından çalıştırılıyor. Orca artık bu yerel kopyayı çalıştırmıyor.",
"managedHostServer": "{{host}} üzerine taşınması gerekiyor",
"missedGraceWindow": "Orca'nın bir sonraki kontrolünde bu çalıştırma, kaçırılan çalıştırmalar için tanınan tolerans süresini aşmıştı.",
"targetMissing": "Otomasyon sunucusu artık kayıtlı olmadığından bu otomasyonun çalışacağı bir yer yok.",
"targetReplaced": "Otomasyon sunucusu kaldırılıp yeniden kaydedildiği için bu otomasyonun çalıştırılmadan önce yeniden ilişkilendirilmesi gerekiyor.",
+1
View File
@@ -4071,6 +4071,7 @@
"noRunnableHost": "此自動化沒有可供執行的主機。",
"wslMoveInProgress": "此自動化的專案正在移至其 WSL 主機,因此 Orca 略過了此次執行。移動完成後便會恢復執行。",
"wslMoveOwnedByHost": "此自動化的專案現在在其 WSL 主機上執行,自動化本身也由該主機執行。Orca 不再執行這個本機副本。",
"managedHostServer": "需要遷移到 {{host}}",
"missedGraceWindow": "Orca 再次檢查時,此次執行的補執行寬限期已過。",
"targetMissing": "自動化主機已不在註冊清單中,因此已無處執行此自動化。",
"targetReplaced": "自動化主機已被移除並重新註冊,因此必須為此自動化重新建立關聯後才能執行。",
+1
View File
@@ -4071,6 +4071,7 @@
"noRunnableHost": "此自动化没有可运行的主机。",
"wslMoveInProgress": "此自动化的项目正在移到其 WSL 主机,因此 Orca 跳过了此次运行。移动完成后将恢复运行。",
"wslMoveOwnedByHost": "此自动化的项目现在在其 WSL 主机上运行,自动化本身也由该主机运行。Orca 不再运行此本地副本。",
"managedHostServer": "需要迁移到 {{host}}",
"missedGraceWindow": "Orca 再次检查时,此次运行的补跑宽限期已过。",
"targetMissing": "自动化主机已不在注册列表中,因此此自动化已无处运行。",
"targetReplaced": "自动化主机已被移除并重新注册,因此必须重新关联此自动化后才能运行。",
+79 -15
View File
@@ -8,7 +8,10 @@ import type { AutomationDestination } from '../shared/automation-owner-precondit
import type { RuntimeWorktreeRecord } from '../shared/runtime-types'
import type { SshTargetSummary } from '../shared/ssh-types'
import type { Repo } from '../shared/repo-types'
import type { RuntimeClient } from './runtime-client'
import { getRepoRoutingConnectionId } from '../shared/execution-host'
import { getManagedOrcadSshTargetId } from '../shared/managed-orcad-execution-host'
import { listEnvironments } from '../shared/remote-runtime/host-store/runtime-environment-store'
import { RuntimeClient } from './runtime-client'
import { fetchSshTargetSummaries } from './host-selector-alternatives'
/** Empty selectors mean the execution host cannot change. */
@@ -17,17 +20,21 @@ export type AutomationDestinationTarget = { repo?: string; workspace?: string }
async function resolveTargetRepo(
client: RuntimeClient,
target: AutomationDestinationTarget
): Promise<Repo> {
): Promise<{ repo: Repo; worktreeId?: string }> {
if (target.repo) {
return (await client.call<{ repo: Repo }>('repo.show', { repo: target.repo })).result.repo
return {
repo: (await client.call<{ repo: Repo }>('repo.show', { repo: target.repo })).result.repo
}
}
const worktree = (
await client.call<{ worktree: RuntimeWorktreeRecord }>('worktree.show', {
worktree: target.workspace
})
).result.worktree
return (await client.call<{ repo: Repo }>('repo.show', { repo: `id:${worktree.repoId}` })).result
.repo
const { repo } = (
await client.call<{ repo: Repo }>('repo.show', { repo: `id:${worktree.repoId}` })
).result
return { repo, worktreeId: worktree.id }
}
// A registered target without a generation needs no fence; an unregistered target is gone.
@@ -43,20 +50,77 @@ async function sshTargetGeneration(
return match.generation
}
type AutomationWriteTarget = {
destination?: AutomationDestination
repo?: Repo
worktreeId?: string
}
async function resolveAutomationWriteTarget(
client: RuntimeClient,
target: AutomationDestinationTarget
): Promise<AutomationWriteTarget> {
if (!target.repo && !target.workspace) {
return {}
}
const { repo, worktreeId } = await resolveTargetRepo(client, target)
const connectionId = getRepoRoutingConnectionId(repo)
if (!connectionId) {
return { destination: { selector: { kind: 'self' } }, repo, worktreeId }
}
const generation = await sshTargetGeneration(client, connectionId)
return generation === undefined
? { repo, worktreeId }
: {
destination: {
selector: { kind: 'ssh', targetId: connectionId, targetGeneration: generation }
},
repo,
worktreeId
}
}
/** The destination an edit names; the desktop refuses one on a managed SSH host. */
export async function resolveAutomationDestination(
client: RuntimeClient,
target: AutomationDestinationTarget
): Promise<AutomationDestination | undefined> {
if (!target.repo && !target.workspace) {
return undefined
return (await resolveAutomationWriteTarget(client, target)).destination
}
/** A local CLI creates a managed SSH host's automation on its Orca server (#24863), by the ids both share. */
export async function routeAutomationCreate<
TCreate extends { repo?: string; workspace?: string; runContext?: unknown }
>(
client: RuntimeClient,
target: AutomationDestinationTarget,
create: TCreate
): Promise<{ writer: RuntimeClient; params: TCreate & { destination?: AutomationDestination } }> {
const { destination, repo, worktreeId } = await resolveAutomationWriteTarget(client, target)
const here = { writer: client, params: { ...create, ...(destination ? { destination } : {}) } }
const connectionId = repo ? getRepoRoutingConnectionId(repo) : null
const server =
repo && connectionId && client.isRemote === false
? listEnvironments(client.userDataPath).find(
(environment) => getManagedOrcadSshTargetId(environment) === connectionId
)
: undefined
if (!repo || !server) {
return here
}
const repo = await resolveTargetRepo(client, target)
const connectionId = repo.connectionId?.trim()
if (!connectionId) {
return { selector: { kind: 'self' } }
const writer = new RuntimeClient(client.userDataPath, undefined, null, server.id)
const { repos } = (await writer.call<{ repos: Pick<Repo, 'id'>[] }>('repo.list')).result
// A project only on the desktop's copy goes to the desktop, which refuses it.
if (!repos.some((entry) => entry.id === repo.id)) {
return here
}
const generation = await sshTargetGeneration(client, connectionId)
return generation === undefined
? undefined
: { selector: { kind: 'ssh', targetId: connectionId, targetGeneration: generation } }
return {
writer,
params: {
...create,
runContext: undefined,
repo: create.repo === undefined ? undefined : `id:${repo.id}`,
...(worktreeId ? { workspace: `id:${worktreeId}` } : {})
}
}
}
+6 -6
View File
@@ -26,7 +26,7 @@ import {
getOptionalStringFlag,
getRequiredStringFlag
} from '../flags'
import { resolveAutomationDestination } from '../automation-destination'
import { resolveAutomationDestination, routeAutomationCreate } from '../automation-destination'
import {
AUTOMATION_RUNS_PAGE_SIZE,
automationRunsRpc,
@@ -199,11 +199,11 @@ export const AUTOMATION_HANDLERS: Record<string, CommandHandler> = {
...schedule
} satisfies AutomationCreateParams
await assertAutomationFieldsSupported(client, create)
const destination = await resolveAutomationDestination(client, target)
const result = await client.call<{ automation: Automation }>('automation.create', {
...create,
...(destination ? { destination } : {})
})
const { writer, params } = await routeAutomationCreate(client, target, create)
if (writer !== client) {
await assertAutomationFieldsSupported(writer, create)
}
const result = await writer.call<{ automation: Automation }>('automation.create', params)
printResult(result, json, formatAutomationShow)
},
'automations edit': async ({ flags, client, cwd, json }) => {
@@ -1,11 +1,14 @@
import { getAppEnvironment } from '../../shared/app-environment'
import type { Automation } from '../../shared/automations-types'
import type { SshTarget } from '../../shared/ssh-types'
import type { Store } from '../persistence/loading-store/store'
import { isManagedOrcadSshTarget } from '../ssh/connection/ssh-connection-store'
import { moveProjectToManagedHostFirst } from '../../shared/managed-orcad-ssh-owner'
import { listOrcadMigrationCutoverChainForTarget } from '../ssh/orcad-migration-cutover-journal'
export const ORCAD_FENCED_AUTOMATION = "This automation now runs on its SSH host's Orca server."
/** While a move is in flight, or once it took this row, any desktop write would break or duplicate it. Rows Move anyway left behind stay runnable here. */
/** While a move is in flight, or once it took this row, any desktop write would break or duplicate it. Rows Move anyway left behind stay listed, skipped by managedOrcadHostOf. */
export function isOrcadFencedAutomation(
store: Pick<Store, 'getSshTarget'>,
automation: Pick<Automation, 'id' | 'executionTargetType' | 'executionTargetId'>,
@@ -33,3 +36,46 @@ export function isOrcadFencedAutomation(
)
)
}
/** A desktop row on a host its managed Orca server now serves: it can never run here (#27499). */
export function managedOrcadHostOf(
store: Pick<Store, 'getSshTarget' | 'automationOwnerPrecondition'>,
automation: Pick<Automation, 'id' | 'executionTargetType' | 'executionTargetId'>
): SshTarget | null {
// The owner selector also covers local rows pinned to an SSH workspace.
const selector = store.automationOwnerPrecondition(automation.id)?.selector
const targetId =
selector?.kind === 'ssh'
? selector.targetId
: automation.executionTargetType === 'ssh'
? automation.executionTargetId
: null
const target = targetId ? store.getSshTarget(targetId) : undefined
return target && isManagedOrcadSshTarget(target) ? target : null
}
type SshLandingRow = Pick<Automation, 'executionTargetType' | 'executionTargetId'>
type SshLandingPin = { targetId: string } | null | undefined
/** The SSH host a row runs on: its own target, or the one its workspace is pinned to. */
function landingSshTargetId(row: SshLandingRow, pin: SshLandingPin): string | undefined {
return row.executionTargetType === 'ssh' ? row.executionTargetId : pin?.targetId
}
/** A desktop row may not newly land on a managed host: it could never run here. */
export function refuseManagedOrcadHost(
state: { sshTargets?: readonly SshTarget[] },
row: SshLandingRow,
pin: SshLandingPin,
previousRow?: SshLandingRow,
previousPin?: SshLandingPin
): void {
const targetId = landingSshTargetId(row, pin)
if (!targetId || (previousRow && landingSshTargetId(previousRow, previousPin) === targetId)) {
return
}
const target = state.sshTargets?.find((entry) => entry.id === targetId)
if (target && isManagedOrcadSshTarget(target)) {
throw new Error(moveProjectToManagedHostFirst(target.label))
}
}
@@ -171,3 +171,59 @@ describe('resolveAutomationRunTarget projectId drift', () => {
})
})
})
describe('resolveAutomationRunTarget on a managed SSH host', () => {
it('skips a desktop row whose SSH host now runs automations on its Orca server', () => {
const sshContext = { hostId: 'ssh:box', path: '/srv/repo' } as const
const store = makeStore(
[makeSetup(sshContext)],
[makeRepo({ connectionId: 'box', path: '/srv/repo' })]
)
store.getSshTarget = (id: string) =>
id === 'box'
? {
id,
label: 'Build box',
host: 'box',
port: 22,
username: 'me',
orcadFence: { environmentId: 'env-1' }
}
: undefined
const automation = makeAutomation(makeRunContext(sshContext), {
executionTargetType: 'ssh',
executionTargetId: 'box'
})
expect(resolveAutomationRunTarget(store, automation)).toMatchObject({
ok: false,
errorCode: 'managedHostServer',
errorParams: { host: 'Build box' }
})
})
})
describe('resolveAutomationRunTarget on a managed SSH workspace pin', () => {
it('skips a local row whose pinned workspace is on a managed SSH host', () => {
const store = makeStore([makeSetup()], [makeRepo()])
store.automationOwnerPrecondition = () => ({
selector: { kind: 'ssh', targetId: 'box', targetGeneration: 7 }
})
store.getSshTarget = (id: string) =>
id === 'box'
? {
id,
label: 'Build box',
host: 'box',
port: 22,
username: 'me',
orcadFence: { environmentId: 'env-1' }
}
: undefined
expect(resolveAutomationRunTarget(store, makeAutomation(makeRunContext()))).toMatchObject({
ok: false,
errorCode: 'managedHostServer'
})
})
})
@@ -21,7 +21,11 @@ import {
type AutomationRunFailure
} from '../../shared/automation-run-failure-copy'
import { AutomationDispatchCancelledError } from './automation-dispatch-cancelled-error'
import { isOrcadFencedAutomation, ORCAD_FENCED_AUTOMATION } from './orcad-fenced-automation'
import {
isOrcadFencedAutomation,
managedOrcadHostOf,
ORCAD_FENCED_AUTOMATION
} from './orcad-fenced-automation'
export type AutomationRunTargetResult =
| { ok: true; cwd: string; repo: Repo; setup?: ProjectHostSetup }
@@ -151,6 +155,10 @@ export function resolveAutomationRunTarget(
automation: Automation,
options: AutomationRunTargetOptions = {}
): AutomationRunTargetResult {
const managedHost = managedOrcadHostOf(store, automation)
if (managedHost) {
return { ok: false, ...automationRunFailure('managedHostServer', { host: managedHost.label }) }
}
const context = automation.runContext ?? null
if (!context) {
return resolveLegacyAutomationRunTarget(store, automation)
@@ -42,6 +42,7 @@ import {
normalizeAutomationSessionReuse,
normalizeAutomationSetupDecisionForWorkspaceMode
} from './automation-context-migration'
import { refuseManagedOrcadHost } from '../../automations/orcad-fenced-automation'
import {
automationProjectionContext,
automationWorkspaceSshPin,
@@ -93,6 +94,7 @@ export function createAutomation(
),
workspaceSshPin
})
refuseManagedOrcadHost(operations.state, executionTarget, workspaceSshPin)
if (options?.destination) {
const context = automationProjectionContext(
operations.state,
@@ -289,6 +291,7 @@ export function updateAutomation(
workspaceSshPin,
workspaceSshPinMoved
})
refuseManagedOrcadHost(operations.state, executionTarget, workspaceSshPin, current, previousPin)
if (options?.destination) {
assertExecutionTargetMatchesDestination(executionTarget, options.destination, workspaceSshPin)
}
@@ -0,0 +1,51 @@
import { describe, expect, it } from 'vitest'
import type { AutomationCreateInput } from '../../../shared/automations-types'
import { getDefaultPersistedState } from '../../../shared/constants'
import { createAutomation } from './automation-definition-operations'
// Desktop rows on a managed SSH host never run; the desktop store refuses new ones for any caller.
describe('desktop automation create on a managed SSH host', () => {
it('refuses the write and keeps the store unchanged', () => {
const state = getDefaultPersistedState('/home/me')
state.sshTargets = [
{
id: 'box',
label: 'Build box',
host: 'box',
port: 22,
username: 'me',
generation: 3,
orcadFence: { environmentId: 'env-1' }
}
]
state.repos = [
{
id: 'repo-1',
path: '/srv/repo',
displayName: 'Repo',
badgeColor: '#000',
addedAt: 1,
connectionId: 'box'
}
]
const input: AutomationCreateInput = {
name: 'Nightly',
prompt: 'Run checks',
agentId: 'claude',
projectId: 'repo-1',
workspaceMode: 'new_per_run',
rrule: 'FREQ=DAILY',
dtstart: 1,
timezone: 'UTC'
}
const operations = {
state,
storageAuthority: 'desktop' as const,
flush: () => undefined,
recordCreated: () => undefined
}
expect(() => createAutomation(operations, input)).toThrow()
expect(state.automations ?? []).toEqual([])
})
})
+6 -2
View File
@@ -33,7 +33,10 @@ import {
} from '../../../../../shared/rpc-contract/ssh-params'
// Keep generation optional so older server rows still key by target id.
function toSshTargetSummary({ id, label, generation }: SshTargetRecord): SshTargetSummary {
function toSshTargetSummary(
target: SshTargetRecord
): SshTargetSummary & Pick<SshEditableTarget, 'managedServer'> {
const { id, label, generation } = target
const state = getRegisteredSshState(id)
const remotePlatform = state?.remotePlatform
return {
@@ -42,7 +45,8 @@ function toSshTargetSummary({ id, label, generation }: SshTargetRecord): SshTarg
...(generation === undefined ? {} : { generation }),
connected: state?.status === 'connected',
...(state?.status === undefined ? {} : { connectionStatus: state.status }),
...(remotePlatform === undefined ? {} : { remotePlatform })
...(remotePlatform === undefined ? {} : { remotePlatform }),
...(isManagedOrcadSshTarget(target) ? { managedServer: true as const } : {})
}
}
@@ -38,6 +38,9 @@ type AutomationDetailProps = {
now: number
onRunNow: (automation: Automation) => void
onEdit: (automation: Automation) => void
/** Moves a row its host's Orca server now serves onto that server. */
onMigrate?: (automation: Automation) => void
isMigrating?: boolean
onToggle: (automation: Automation) => void
onDelete: (automation: Automation) => void
}
@@ -123,6 +126,8 @@ export function AutomationDetail({
now,
onRunNow,
onEdit,
onMigrate,
isMigrating,
onToggle,
onDelete
}: AutomationDetailProps): React.JSX.Element {
@@ -177,9 +182,14 @@ export function AutomationDetail({
<div className="flex items-center gap-2">
<h2 className="truncate text-lg font-semibold">{automation.name}</h2>
<Badge variant={automation.enabled ? 'secondary' : 'outline'}>
{automation.enabled
? translate('auto.components.automations.AutomationDetail.eaa02014f8', 'Enabled')
: translate('auto.components.automations.enablement.paused', 'Paused')}
{!automation.enabled
? translate('auto.components.automations.enablement.paused', 'Paused')
: hostEntry?.servedBy
? translate(
'auto.components.automations.AutomationDetail.needsMigration',
'Needs migration'
)
: translate('auto.components.automations.AutomationDetail.eaa02014f8', 'Enabled')}
</Badge>
</div>
<p className="mt-1 truncate text-sm text-muted-foreground">
@@ -245,7 +255,26 @@ export function AutomationDetail({
</div>
</div>
{automation.executionTargetType === 'ssh' ? (
{hostEntry?.servedBy ? (
<div className="flex items-center justify-between gap-3 rounded-md border border-border/50 bg-muted/50 p-3 text-sm text-muted-foreground shadow-sm">
<span className="min-w-0">
{translate(
'auto.components.automations.AutomationDetail.migrateNotice',
'{{host}} was upgraded to a new remote host. Migrate this automation to keep it running.',
{ host: hostEntry.label }
)}
</span>
<Button
variant="secondary"
size="sm"
className="shrink-0"
disabled={isMigrating}
onClick={() => onMigrate?.(automation)}
>
{translate('auto.components.automations.AutomationDetail.migrate', 'Migrate')}
</Button>
</div>
) : automation.executionTargetType === 'ssh' ? (
<div className="rounded-md border border-border/50 bg-muted/50 p-3 text-sm text-muted-foreground shadow-sm">
{translate(
'auto.components.automations.AutomationDetail.dbef8dc110',
@@ -254,7 +283,7 @@ export function AutomationDetail({
</div>
) : null}
{runNowAvailability?.canRunNow === false ? (
{runNowAvailability?.canRunNow === false && !hostEntry?.servedBy ? (
<div className="rounded-md border border-border/50 bg-muted/40 p-3 text-sm text-muted-foreground shadow-sm">
{runNowAvailability.message}
</div>
@@ -46,7 +46,7 @@ import { AutomationListLastRunCell } from './AutomationListLastRunCell'
import { formatAutomationDateTimeWithRelative } from './automation-page-parts'
import { getAutomationTargetAvailability } from './automation-target-availability'
import { getAgentLabel } from './automation-draft-model'
import type { AutomationListRow } from './automation-list-row-identity'
import { automationProjectName, type AutomationListRow } from './automation-list-row-identity'
import { formatAutomationUsageSummary } from './automation-usage-model'
import { AUTOMATIONS_TABLE_GRID_CLASS } from './automations-table-layout'
import {
@@ -78,6 +78,7 @@ export type AutomationListLocalRowProps = {
hostTargetFor: (row: AutomationListRow) => AutomationHostTarget | null
hostLabelById?: ReadonlyMap<string, string>
isActionEnabled?: (row: AutomationListRow, action: AutomationRowAction) => boolean
needsMigration?: (row: AutomationListRow) => boolean
onSelect: (rowKey: string) => void
onRunNow: (row: AutomationListRow) => void
onEdit: (row: AutomationListRow) => void
@@ -105,6 +106,7 @@ export function AutomationListLocalRow({
hostTargetFor,
hostLabelById = EMPTY_HOST_LABELS,
isActionEnabled,
needsMigration,
onSelect,
onRunNow,
onEdit,
@@ -134,7 +136,7 @@ export function AutomationListLocalRow({
automationHostTarget: hostTargetFor(row)
})
const projectLabel =
automationRepo?.displayName ??
automationProjectName(automation, automationRepo, repoMap, !!needsMigration?.(row)) ??
translate('auto.components.automations.AutomationsPage.13118faadf', 'Unknown project')
const scheduleLabel = formatUiAutomationSchedule(automation.rrule)
const nextRunLabel = automation.enabled
@@ -264,7 +266,11 @@ export function AutomationListLocalRow({
{nextRunLabel}
</span>
<AutomationListLastRunCell snapshot={lastRunSnapshot} now={relativeNow} />
<AutomationListStatusCell enabled={automation.enabled} movedToDistro={movedToDistro} />
<AutomationListStatusCell
enabled={automation.enabled}
movedToDistro={movedToDistro}
needsMigration={needsMigration?.(row)}
/>
<Tooltip>
<TooltipTrigger asChild>
<span
@@ -4,11 +4,14 @@ import { translate } from '@/i18n/i18n'
export function AutomationListStatusCell({
enabled,
movedToDistro = null
movedToDistro = null,
needsMigration = false
}: {
enabled: boolean
/** A moved project's local copy: the host runs it, never this computer. */
movedToDistro?: string | null
/** A copy its host's Orca server now serves: it runs only once migrated. */
needsMigration?: boolean
}): React.JSX.Element {
if (movedToDistro) {
const label = translate(
@@ -22,6 +25,17 @@ export function AutomationListStatusCell({
</span>
)
}
if (enabled && needsMigration) {
const label = translate(
'auto.components.automations.AutomationDetail.needsMigration',
'Needs migration'
)
return (
<span className="min-w-0 line-clamp-2 leading-tight text-muted-foreground" title={label}>
{label}
</span>
)
}
if (enabled) {
return (
<span className="inline-flex min-w-0 items-center gap-1 truncate text-muted-foreground">
@@ -53,6 +53,8 @@ type AutomationsDetailPaneProps = {
) => void
runNow: (automation: Automation) => void
openEditDialog: (automation: Automation) => void
migrateAutomation?: (automation: Automation) => void
isMigrating?: boolean
toggleAutomation: (automation: Automation) => void
requestDeleteAutomation: (automation: Automation) => void
openAutomationRunPage: (run: AutomationRun) => void
@@ -79,6 +81,8 @@ export function AutomationsDetailPane({
requestExternalAction,
runNow,
openEditDialog,
migrateAutomation,
isMigrating,
toggleAutomation,
requestDeleteAutomation,
openAutomationRunPage,
@@ -192,6 +196,8 @@ export function AutomationsDetailPane({
now={relativeNow}
onRunNow={(automation) => void runNow(automation)}
onEdit={(automation) => void openEditDialog(automation)}
onMigrate={migrateAutomation}
isMigrating={isMigrating}
onToggle={(automation) => void toggleAutomation(automation)}
onDelete={requestDeleteAutomation}
/>
@@ -91,6 +91,7 @@ export type AutomationsListPanelProps = {
hostTargetFor: (row: AutomationListRow) => AutomationHostTarget | null
hostLabelById?: ReadonlyMap<string, string>
isActionEnabled: (row: AutomationListRow, action: AutomationRowAction) => boolean
needsMigration?: (row: AutomationListRow) => boolean
externalActionKey: string | null
selectAutomationRow: (rowKey: string | null) => void
selectExternalKey: (externalKey: string | null) => void
@@ -144,6 +145,7 @@ export function AutomationsListPanel(props: AutomationsListPanelProps): React.JS
hostTargetFor,
hostLabelById,
isActionEnabled,
needsMigration,
externalActionKey,
selectAutomationRow,
selectExternalKey,
@@ -273,6 +275,7 @@ export function AutomationsListPanel(props: AutomationsListPanelProps): React.JS
hostTargetFor,
hostLabelById,
isActionEnabled,
needsMigration,
onSelect: (rowKey: string) => {
selectExternalKey(null)
selectAutomationRow(rowKey)
@@ -96,6 +96,7 @@ export function AutomationsPageListPanel({
hostTargetFor={destination.automationHostTargetFor}
hostLabelById={presentation.hostLabelById}
isActionEnabled={destination.isAutomationRowActionEnabled}
needsMigration={(row) => !!destination.rowRecoveryHost(row.key)?.servedBy}
externalActionKey={externalActionKey}
selectAutomationRow={list.selectAutomationRow}
selectExternalKey={local.selectExternalKey}
@@ -5,7 +5,7 @@ import { AutomationEditorDialog } from './AutomationEditorDialog'
import { AutomationsDetailPane } from './AutomationsDetailPane'
import { AutomationsPageSkeleton } from './AutomationsPageSkeleton'
import { getAutomationAuthorityTarget } from './automation-host-client'
import type { AutomationListRow } from './automation-list-row-identity'
import { automationProjectName, type AutomationListRow } from './automation-list-row-identity'
import type { AutomationHostRecoveryAction } from './automation-host-status-descriptors'
import { AutomationsPageTopBar } from './AutomationsPageTopBar'
import type { AutomationsPageController } from './use-automations-page-controller'
@@ -32,6 +32,7 @@ export function AutomationsPageSurface({
draftEffects,
editorActions,
saveAutomation,
migrateAction,
managementActions,
runActions,
externalActions,
@@ -268,7 +269,13 @@ export function AutomationsPageSurface({
relativeNow={relativeNow}
externalActionKey={externalActionKey}
selectedRepoDisplayName={
presentation.selectedRepo?.displayName ??
(selected &&
automationProjectName(
selected,
presentation.selectedRepo,
repoMap,
!!destination.rowRecoveryHost(selectedRow?.key ?? null)?.servedBy
)) ??
translate('auto.components.automations.AutomationsPage.13118faadf', 'Unknown project')
}
selectedRepoDefaultBaseRef={presentation.selectedRepo?.worktreeBaseRef ?? null}
@@ -291,6 +298,8 @@ export function AutomationsPageSurface({
requestExternalAction={externalActions.requestExternalAction}
runNow={() => runSelectedRowAction(runActions.runNow)}
openEditDialog={() => runSelectedRowAction(editorActions.openEditDialog)}
migrateAutomation={() => runSelectedRowAction(migrateAction.migrateAutomation)}
isMigrating={!!selectedRow && migrateAction.migratingRowKey === selectedRow.key}
toggleAutomation={() => runSelectedRowAction(managementActions.toggleAutomation)}
requestDeleteAutomation={() =>
runSelectedRowAction(managementActions.requestDeleteAutomation)
@@ -0,0 +1,48 @@
import { describe, expect, it } from 'vitest'
import { buildAutomationHostCatalog } from './automation-host-catalog'
import type { AutomationCatalogSshMirrorInput } from './automation-host-catalog-types'
import {
automationCreateHostOffered,
preselectAutomationCreateHost
} from './automation-create-destination'
function mirror(
targets: AutomationCatalogSshMirrorInput['targets']
): AutomationCatalogSshMirrorInput {
return {
targetsHydrated: true,
targets,
removedTargetLabels: new Map(),
connectionStatusByTargetId: new Map()
}
}
describe('create destination on a managed SSH host', () => {
it("lists only the host's server and lands its desktop SSH key there", () => {
const { entries } = buildAutomationHostCatalog({
desktop: {
label: 'Local Mac',
ssh: mirror([{ targetId: 'box', label: 'Build box', generation: 2 }])
},
runtimes: [
{
environmentId: 'env-1',
label: 'Build box',
pairingRevision: 3,
authorityHealth: 'fresh',
querySupport: 'scoped',
ssh: mirror([]),
managedSshTargetId: 'box'
}
],
runtimeCatalogSettled: true
})
const desktopSshKey = 'host:desktop:ssh:box'
const desktopSsh = entries.find((entry) => entry.stableKey === desktopSshKey)
expect(desktopSsh && automationCreateHostOffered(desktopSsh)).toBe(false)
expect(preselectAutomationCreateHost(entries, desktopSshKey, null)?.stableKey).toBe(
'host:runtime:env-1:self'
)
})
})
@@ -42,12 +42,29 @@ export type AutomationCreateDestinationResolution =
export function automationCreateHostEligible(
entry: AutomationHostCatalogEntry
): entry is AutomationHostCatalogEntry & { owner: AutomationOwnerRef } {
return entry.kind !== 'orphan' && entry.owner !== null && entry.querySupport === 'scoped'
return (
entry.kind !== 'orphan' &&
entry.owner !== null &&
entry.querySupport === 'scoped' &&
entry.servedBy === undefined
)
}
/** Offer ineligible hosts disabled with reasons so they do not appear gone; hide only removed targets and the orphan bucket. */
/** The entry that holds new automations for a host key: a managed SSH host's is its Orca server's. */
export function automationCreateHostFor(
entries: readonly AutomationHostCatalogEntry[],
stableKey: string | null | undefined
): AutomationHostCatalogEntry | null {
const entry = stableKey ? entries.find((candidate) => candidate.stableKey === stableKey) : null
const server = entry?.servedBy
? entries.find((candidate) => candidate.stableKey === entry.servedBy)
: null
return server ?? entry ?? null
}
/** Offer ineligible hosts disabled with reasons so they do not appear gone; hide removed targets, the orphan bucket, and SSH hosts their Orca server stands for. */
export function automationCreateHostOffered(entry: AutomationHostCatalogEntry): boolean {
return entry.kind !== 'orphan' && entry.catalogState !== 'removed'
return entry.kind !== 'orphan' && entry.catalogState !== 'removed' && entry.servedBy === undefined
}
/** Name only authorities repaired by a server update; disabled tooltips are unreachable, and unverified targets need reconnect instead. */
@@ -88,11 +105,7 @@ export function preselectAutomationCreateHost(
selectedStableKey: string | null,
activeWorkspaceStableKey: string | null
): AutomationHostCatalogEntry | null {
const key = selectedStableKey ?? activeWorkspaceStableKey
if (!key) {
return null
}
return entries.find((entry) => entry.stableKey === key) ?? null
return automationCreateHostFor(entries, selectedStableKey ?? activeWorkspaceStableKey)
}
/** Revalidate against the live catalog; report a changed incarnation without silently following it or discarding the form. */
@@ -30,6 +30,7 @@ export type AutomationCatalogRuntimeSource = {
/** Undefined until this client has probed the environment at all. */
status: { status: RuntimeStatus | null } | undefined
ssh: AutomationCatalogSshSource | undefined
managedSshTargetId?: string
}
export type AutomationHostCatalogSource = {
@@ -129,6 +130,7 @@ export function buildAutomationHostCatalogSource(
authorityHealth: runtimeAuthorityHealth(runtime),
querySupport: runtimeQuerySupport(runtime),
ssh: toSshMirror(runtime.ssh ?? EMPTY_SSH),
...(runtime.managedSshTargetId ? { managedSshTargetId: runtime.managedSshTargetId } : {}),
...withOrphanCount(orphanCountFor(source, authority))
}
}),
@@ -53,6 +53,8 @@ export type AutomationHostCatalogEntry = {
querySupport: AutomationHostQuerySupport
/** Present only while `querySupport` is degraded; explains which repair, if any, applies. */
scopeGap?: AutomationHostScopeGap
/** A desktop SSH host whose managed Orca server owns its automations: that server's self entry. */
servedBy?: string
}
export type AutomationCatalogSshTargetInput = {
@@ -91,6 +93,8 @@ export type AutomationRuntimeAuthorityInput = {
querySupport: AutomationHostQuerySupport
ssh: AutomationCatalogSshMirrorInput
orphanCount?: number
/** The desktop SSH target this runtime is the managed Orca server for. */
managedSshTargetId?: string
}
export type AutomationHostCatalogInput = {
@@ -41,6 +41,8 @@ type AuthorityProjectionContext = {
ssh: AutomationCatalogSshMirrorInput
referenced: ReferencedAuthorityScope
orphanCount: number | undefined
/** Desktop SSH target id to the self entry of the managed Orca server that serves it. */
servedBy?: ReadonlyMap<string, string>
}
const EMPTY_SCOPE: ReferencedAuthorityScope = { targetIds: new Set(), orphan: false }
@@ -100,6 +102,10 @@ function withScopeGap(scopeGap: AutomationHostScopeGap | undefined): {
return scopeGap === undefined ? {} : { scopeGap }
}
function withServedBy(servedBy: string | undefined): { servedBy?: string } {
return servedBy === undefined ? {} : { servedBy }
}
/** The authority's own contract; the only gap an entry with no target can have. */
function authorityScopeGap(
querySupport: AutomationHostQuerySupport
@@ -202,7 +208,8 @@ function projectSshEntries(ctx: AuthorityProjectionContext): AutomationHostCatal
// Why: without a registration generation the entry keys on target id alone, so it stays view-only.
querySupport:
ctx.querySupport === 'scoped' && !scoped ? 'legacy-unscoped' : ctx.querySupport,
...withScopeGap(resolveSshScopeGap(ctx.querySupport, catalogState, generation))
...withScopeGap(resolveSshScopeGap(ctx.querySupport, catalogState, generation)),
...withServedBy(ctx.servedBy?.get(targetId))
}
)
)
@@ -255,7 +262,22 @@ export function buildAutomationHostCatalog(
pairingRevision: null,
ssh: input.desktop.ssh,
referenced: referenced.get(automationAuthorityCatalogKey(desktopAuthority)) ?? EMPTY_SCOPE,
orphanCount: input.desktop.orphanCount
orphanCount: input.desktop.orphanCount,
servedBy: new Map(
input.runtimes.flatMap((runtime) =>
runtime.managedSshTargetId
? [
[
runtime.managedSshTargetId,
hostStableKey({
authority: { kind: 'runtime', environmentId: runtime.environmentId },
selector: { kind: 'self' }
})
] as const
]
: []
)
)
}
const contexts: AuthorityProjectionContext[] = [
...(desktopAliasEnvironmentId === undefined ? [desktopContext] : []),
@@ -68,6 +68,19 @@ export function unscopedAutomationListRows(
}))
}
/** A project moved to its host's Orca server keeps its id, so a leftover still names it. */
export function automationProjectName(
automation: Automation,
repo: Repo | null | undefined,
repoMap: ReadonlyMap<string, Repo>,
leftover: boolean
): string | undefined {
return (
repo?.displayName ??
(leftover ? repoMap.get(getAutomationRunRepoId(automation))?.displayName : undefined)
)
}
export function automationRepoForRow(
row: AutomationListRow,
repos: readonly Repo[]
@@ -47,7 +47,6 @@ export async function saveOrcaAutomation(
draft,
editingAutomationId,
editingRowKey,
editingDestination,
draftAtOpen,
setEditorNotice,
setEditorNoticeHost,
@@ -60,7 +59,8 @@ export async function saveOrcaAutomation(
rowRecoveryHost,
createDestination
} = destination
const { dialogRepos, editHostResolution, automationDialogTarget } = destinationForm
const { dialogRepos, editHostResolution, automationDialogTarget, editingDestination } =
destinationForm
// Fence the destination before hook probes/trust prompts or any other transaction side effect.
const createCheck = editingAutomationId === null ? createDestination.check(draft.projectId) : null
@@ -42,6 +42,12 @@ const COPY: Record<
translate('automations.runFailures.wslMoveInProgress', EN.wslMoveInProgress),
wslMoveOwnedByHost: () =>
translate('automations.runFailures.wslMoveOwnedByHost', EN.wslMoveOwnedByHost),
managedHostServer: (params) => {
const host = params?.host
return typeof host === 'string'
? translate('automations.runFailures.managedHostServer', EN.managedHostServer, { host })
: null
},
missedGraceWindow: () =>
translate('automations.runFailures.missedGraceWindow', EN.missedGraceWindow),
targetMissing: () => translate('automations.runFailures.targetMissing', EN.targetMissing),
@@ -6,6 +6,7 @@ import { AUTOMATION_DEFAULT_TIME, getDefaultWorktree } from './automation-draft-
import type { AutomationTemplate } from './automation-templates'
import { dispatchAutomationReread } from './automation-row-action-dispatch'
import { listAutomationsForTarget } from './automation-host-client'
import { automationCreateHostFor } from './automation-create-destination'
import type { AutomationDraft } from './AutomationEditorDialog'
import type { AutomationListRow } from './automation-list-row-identity'
import type { AutomationsPageDestinationState } from './use-automations-page-destination-state'
@@ -42,7 +43,8 @@ export function useAutomationEditorActions({
editingHostStableKey
} = local
const { getDefaultTarget, automationDispatchContext, rowRecoveryHost } = destination
const { destinationForProject, editHostResolution, editDestinationControl } = destinationForm
const { destinationForProject, editHostResolution, editDestinationControl, editHostEntries } =
destinationForm
const openCreateDialog = (template?: AutomationTemplate): void => {
editRequestRef.current += 1
@@ -89,7 +91,11 @@ export function useAutomationEditorActions({
setCreateOpen(true)
}
const openEditDialog = async (row: AutomationListRow): Promise<void> => {
/** Resolves true once the edit session is set; headless keeps the dialog closed for Migrate. */
const openEditDialog = async (
row: AutomationListRow,
{ headless = false }: { headless?: boolean } = {}
): Promise<boolean> => {
const requestId = (editRequestRef.current += 1)
const automationId = row.automation.id
const reread = await dispatchAutomationReread(
@@ -102,25 +108,34 @@ export function useAutomationEditorActions({
)
if (!reread.ok && reread.notice.severity === 'owner') {
destination.reportOwnerAction(row.key, reread.notice)
return
return false
}
const latest = (reread.ok ? reread.value : null) ?? row.automation
if (requestId !== editRequestRef.current) {
return
return false
}
setEditingAutomationId(latest.id)
setEditingRowKey(row.key)
const initialHostStableKey = rowRecoveryHost(row.key)?.stableKey ?? null
const initialDestination = destinationForProject(latest.projectId, initialHostStableKey)
const rowHostStableKey = rowRecoveryHost(row.key)?.stableKey ?? null
const initialHost = automationCreateHostFor(editHostEntries, rowHostStableKey)
// A managed SSH host's row can only be saved by moving it to that host's Orca server.
const movingToServer = initialHost !== null && initialHost.stableKey !== rowHostStableKey
const initialDestination = destinationForProject(
latest.projectId,
initialHost?.stableKey ?? null
)
setEditingDestination(
initialDestination ? { projectId: latest.projectId, destination: initialDestination } : null
)
setEditingHostStableKey(initialDestination?.entry.stableKey ?? null)
setEditingHostStableKey(
initialDestination?.entry.stableKey ?? (movingToServer ? initialHost.stableKey : null)
)
const nextDraft = buildAutomationEditDraft(latest)
setDraft(nextDraft)
setDraftAtOpen(nextDraft)
setTargetEdited(false)
setCreateOpen(true)
setTargetEdited(movingToServer)
setCreateOpen(!headless)
return true
}
const handleProjectChange = useCallback(
@@ -2,6 +2,7 @@ import { useMemo } from 'react'
import { useAppStore } from '@/store'
import { getPairedWebClientEnvironmentId } from '@/lib/paired-web-client-host'
import type { PublicKnownRuntimeEnvironment } from '../../../../shared/remote-runtime/host-catalog/runtime-environments'
import { getManagedOrcadSshTargetId } from '../../../../shared/managed-orcad-execution-host'
import type {
AutomationCatalogRuntimeSource,
AutomationCatalogSshSource,
@@ -55,6 +56,7 @@ export function useAutomationHostCatalogSourceState({
runtimeEnvironments.map((environment) => {
const bucket = sshStateByEnvironment.get(environment.id)
const status = runtimeStatusByEnvironmentId.get(environment.id)
const managedSshTargetId = getManagedOrcadSshTargetId(environment)
return {
environmentId: environment.id,
label: environment.name,
@@ -69,7 +71,8 @@ export function useAutomationHostCatalogSourceState({
removedTargetLabels: bucket.removedTargetLabels,
connectionStates: bucket.connectionStates
}
: undefined
: undefined,
...(managedSshTargetId ? { managedSshTargetId } : {})
}
}),
[runtimeEnvironments, runtimeStatusByEnvironmentId, sshStateByEnvironment]
@@ -0,0 +1,62 @@
import { useEffect, useEffectEvent, useState } from 'react'
import { toast } from 'sonner'
import { resolveAutomationCreateDestination } from './automation-create-destination'
import { createAutomationSaveAction } from './automation-save-action'
import type { AutomationSaveContext } from './automation-save-context'
import type { AutomationListRow } from './automation-list-row-identity'
import type { AutomationEditorActions } from './use-automation-editor-actions'
/** Migrate: the editor's own move-to-server save, run without opening the dialog. */
export function useAutomationMigrateAction(
context: AutomationSaveContext,
editorActions: AutomationEditorActions
) {
const [migration, setMigration] = useState<{ rowKey: string; opened: boolean } | null>(null)
// Runs on the render that holds the headless edit session, so Save reads it like the dialog would.
const saveMigration = useEffectEvent(async () => {
const save = createAutomationSaveAction({
...context,
local: {
...context.local,
// No dialog is open to show editor notices.
setEditorNotice: (notice) => {
if (notice && typeof notice !== 'function') {
toast.error(notice.message)
}
},
setEditorNoticeHost: () => {}
}
})
try {
await save()
} finally {
setMigration(null)
}
})
useEffect(() => {
if (migration?.opened) {
void saveMigration()
}
}, [migration])
const migrateAutomation = async (row: AutomationListRow): Promise<void> => {
setMigration({ rowKey: row.key, opened: false })
let opened = false
try {
const servedBy = context.destination.rowRecoveryHost(row.key)?.servedBy
const server = resolveAutomationCreateDestination(
context.list.hostCatalog.entries.find((entry) => entry.stableKey === servedBy)
)
// Save checks the project against the server's repo table, which may not be loaded yet.
if (server.status === 'ready' && server.authority.kind === 'runtime') {
await context.store.fetchRuntimeEnvironmentRepos(server.authority.environmentId)
}
opened = await editorActions.openEditDialog(row, { headless: true })
} finally {
setMigration(opened ? { rowKey: row.key, opened: true } : null)
}
}
return { migrateAutomation, migratingRowKey: migration?.rowKey ?? null }
}
@@ -4,6 +4,7 @@ import { createAutomationRunWorkspaceAction } from './automation-run-workspace-a
import { createAutomationSaveAction } from './automation-save-action'
import { useAutomationDraftEffects } from './use-automation-draft-effects'
import { useAutomationEditorActions } from './use-automation-editor-actions'
import { useAutomationMigrateAction } from './use-automation-migrate-action'
import { useAutomationRunPageState } from './use-automation-run-page-state'
import { useAutomationsPageEscape } from './use-automations-page-escape'
import { useAutomationsPageListState } from './use-automations-page-list-state'
@@ -69,15 +70,9 @@ export function useAutomationsPageController() {
destination,
destinationForm
})
const saveAutomation = createAutomationSaveAction({
store,
local,
list,
setup,
destination,
destinationForm,
pageRefresh
})
const saveContext = { store, local, list, setup, destination, destinationForm, pageRefresh }
const saveAutomation = createAutomationSaveAction(saveContext)
const migrateAction = useAutomationMigrateAction(saveContext, editorActions)
const actionContext = {
store,
local,
@@ -108,6 +103,7 @@ export function useAutomationsPageController() {
draftEffects,
editorActions,
saveAutomation,
migrateAction,
managementActions,
runActions,
externalActions,
@@ -11,6 +11,7 @@ import { automationWorktreesForRepo } from './automation-list-row-identity'
import { getAutomationCreateRepos } from './automation-create-projects'
import {
automationCreateEligibleProjects,
automationCreateHostFor,
automationCreateHostStableKey,
automationCreateProjectMismatch,
resolveAutomationCreateDestination,
@@ -129,10 +130,18 @@ export function useAutomationsPageDestinationForm({
automationAuthorityCatalogKey(editHostResolution.authority) !== dialogAuthorityKey
? editHostResolution.entry
: null
// A host's project table can load after the editor opened on it; the chosen project then holds.
const editingDestination =
local.editingDestination ??
(editHostResolution.status === 'ready' &&
draft.projectId &&
!automationCreateProjectMismatch(repoTables, editHostResolution, draft.projectId)
? { projectId: draft.projectId, destination: editHostResolution }
: null)
const editSaveDestination = resolveAutomationEditDestination({
currentAutomation: editingRow?.automation ?? null,
editingAutomationId,
editingDestination: local.editingDestination,
editingDestination,
draft,
targetEdited: local.targetEdited,
rowKey: editingRowKey,
@@ -252,10 +261,10 @@ export function useAutomationsPageDestinationForm({
if (!runContext) {
return null
}
const stableKey = automationCreateHostStableKey(runContext.hostId)
const entry = stableKey
? hostCatalog.entries.find((candidate) => candidate.stableKey === stableKey)
: undefined
const entry = automationCreateHostFor(
hostCatalog.entries,
automationCreateHostStableKey(runContext.hostId)
)
const resolved = resolveAutomationCreateDestination(entry)
return resolved.status === 'ready' ? resolved : null
},
@@ -264,6 +273,7 @@ export function useAutomationsPageDestinationForm({
return {
editingRow,
editingDestination,
editorSaveAuthority,
recordedTargetSelected,
editingRowCapturedOwner,
+2 -1
View File
@@ -1316,7 +1316,8 @@
"workspaceHostAmbiguous": "The automation workspace spans more than one host, so Orca cannot tell which one to run it on.",
"wslDistroStopped": "The WSL distro {{distro}} is stopped, so this scheduled run did not start it. Start the distro or use Run now; later runs go ahead while it runs.",
"wslMoveInProgress": "This automation's project is moving to its WSL host, so Orca skipped this run. Runs resume when the move finishes.",
"wslMoveOwnedByHost": "This automation's project now runs on its WSL host, which runs this automation there. Orca no longer runs this local copy."
"wslMoveOwnedByHost": "This automation's project now runs on its WSL host, which runs this automation there. Orca no longer runs this local copy.",
"managedHostServer": "Needs migration to {{host}}"
}
},
"browser": {
+5 -1
View File
@@ -17556,7 +17556,10 @@
"reuseLiveSession": "Laufende Sitzung wiederverwenden",
"freshEachRun": "Bei jeder Ausführung neu",
"precheckEnabled": "Aktiviert, {{timeout}}",
"precheckNone": "Keine"
"precheckNone": "Keine",
"migrate": "Migrieren",
"migrateNotice": "{{host}} wurde auf einen neuen Remote-Host umgestellt. Migriere diese Automatisierung, damit sie weiterläuft.",
"needsMigration": "Migration erforderlich"
},
"AutomationEditorDialog": {
"fb1896a5e7": "Abbrechen",
@@ -23018,6 +23021,7 @@
"noRunnableHost": "Dieser Automatisierung fehlt ein Host zur Ausführung.",
"wslMoveInProgress": "Das Projekt dieser Automatisierung wird auf seinen WSL-Host verschoben. Deshalb hat Orca diese Ausführung übersprungen. Die Ausführungen werden nach Abschluss des Verschiebens fortgesetzt.",
"wslMoveOwnedByHost": "Das Projekt dieser Automatisierung läuft jetzt auf seinem WSL-Host, der die Automatisierung dort ausführt. Orca führt diese lokale Kopie nicht mehr aus.",
"managedHostServer": "Migration zu {{host}} erforderlich",
"missedGraceWindow": "Bei der nächsten Prüfung durch Orca war die Nachholfrist für diese verpasste Ausführung bereits abgelaufen.",
"targetMissing": "Der Host der Automatisierung ist nicht mehr registriert. Daher gibt es für diese Automatisierung keinen Ausführungsort.",
"targetReplaced": "Der Host der Automatisierung wurde entfernt und erneut registriert. Daher muss diese Automatisierung vor der Ausführung erneut zugeordnet werden.",
+5 -1
View File
@@ -17952,7 +17952,10 @@
"reuseLiveSession": "Reuse live session",
"freshEachRun": "Fresh each run",
"precheckEnabled": "Enabled, {{timeout}}",
"precheckNone": "None"
"precheckNone": "None",
"migrate": "Migrate",
"migrateNotice": "{{host}} was upgraded to a new remote host. Migrate this automation to keep it running.",
"needsMigration": "Needs migration"
},
"AutomationEditorDialog": {
"fb1896a5e7": "Cancel",
@@ -23770,6 +23773,7 @@
"noRunnableHost": "This automation has no host to run on.",
"wslMoveInProgress": "This automation's project is moving to its WSL host, so Orca skipped this run. Runs resume when the move finishes.",
"wslMoveOwnedByHost": "This automation's project now runs on its WSL host, which runs this automation there. Orca no longer runs this local copy.",
"managedHostServer": "Needs migration to {{host}}",
"missedGraceWindow": "This run was past its missed-run grace window when Orca next checked.",
"targetMissing": "The automation host is no longer registered, so this automation has nowhere to run.",
"targetReplaced": "The automation host was removed and re-registered, so this automation must be re-adopted before it can run.",
+5 -1
View File
@@ -17319,7 +17319,10 @@
"reuseLiveSession": "Reutilizar sesión activa",
"freshEachRun": "Nueva en cada ejecución",
"precheckEnabled": "Activada, {{timeout}}",
"precheckNone": "Ninguna"
"precheckNone": "Ninguna",
"migrate": "Migrar",
"migrateNotice": "{{host}} se actualizó a un nuevo host remoto. Migra esta automatización para que siga ejecutándose.",
"needsMigration": "Requiere migración"
},
"AutomationEditorDialog": {
"fb1896a5e7": "Cancelar",
@@ -23455,6 +23458,7 @@
"noRunnableHost": "Esta automatización no tiene host donde ejecutarse.",
"wslMoveInProgress": "El proyecto de esta automatización se está moviendo a su host WSL, por lo que Orca omitió esta ejecución. Las ejecuciones se reanudarán cuando termine el traslado.",
"wslMoveOwnedByHost": "El proyecto de esta automatización ahora se ejecuta en su host WSL, que ejecuta allí esta automatización. Orca ya no ejecuta esta copia local.",
"managedHostServer": "Requiere migración a {{host}}",
"missedGraceWindow": "Cuando Orca volvió a comprobarlo, ya había vencido el período de gracia para recuperar esta ejecución omitida.",
"targetMissing": "El host de la automatización ya no está registrado, por lo que esta automatización no tiene dónde ejecutarse.",
"targetReplaced": "El host de la automatización se eliminó y se volvió a registrar, por lo que hay que volver a vincular esta automatización antes de poder ejecutarla.",
+5 -1
View File
@@ -17514,7 +17514,10 @@
"reuseLiveSession": "Réutiliser la session active",
"freshEachRun": "Nouvelle à chaque exécution",
"precheckEnabled": "Activée, {{timeout}}",
"precheckNone": "Aucune"
"precheckNone": "Aucune",
"migrate": "Migrer",
"migrateNotice": "{{host}} a été mis à niveau vers un nouvel hôte distant. Migrez cette automatisation pour qu'elle continue de s'exécuter.",
"needsMigration": "Migration requise"
},
"AutomationEditorDialog": {
"fb1896a5e7": "Annuler",
@@ -23455,6 +23458,7 @@
"noRunnableHost": "Cette automatisation n’a pas d’hôte sur lequel s’exécuter.",
"wslMoveInProgress": "Le projet de cette automatisation est en cours de déplacement vers son hôte WSL. Orca a donc ignoré cette exécution. Les exécutions reprendront à la fin du déplacement.",
"wslMoveOwnedByHost": "Le projet de cette automatisation s’exécute désormais sur son hôte WSL, qui y exécute cette automatisation. Orca n’exécute plus cette copie locale.",
"managedHostServer": "Migration vers {{host}} requise",
"missedGraceWindow": "Lors de la vérification suivante par Orca, la marge de rattrapage de cette exécution manquée était déjà dépassée.",
"targetMissing": "L’hôte de l’automatisation n’est plus enregistré. Cette automatisation n’a donc plus d’hôte sur lequel s’exécuter.",
"targetReplaced": "L’hôte de l’automatisation a été supprimé puis réenregistré. Cette automatisation doit donc être rattachée à nouveau avant de pouvoir s’exécuter.",
+5 -1
View File
@@ -16902,7 +16902,10 @@
"reuseLiveSession": "実行中のセッションを再利用",
"freshEachRun": "実行ごとに新規作成",
"precheckEnabled": "有効、{{timeout}}",
"precheckNone": "なし"
"precheckNone": "なし",
"migrate": "移行",
"migrateNotice": "{{host}} は新しいリモートホストにアップグレードされました。実行を続けるには、この自動化を移行してください。",
"needsMigration": "移行が必要"
},
"AutomationEditorDialog": {
"fb1896a5e7": "キャンセル",
@@ -22765,6 +22768,7 @@
"noRunnableHost": "このオートメーションには実行するホストがありません。",
"wslMoveInProgress": "このオートメーションのプロジェクトを WSL ホストへ移動中のため、Orca は今回の実行をスキップしました。移動が完了すると実行が再開されます。",
"wslMoveOwnedByHost": "このオートメーションのプロジェクトは現在 WSL ホスト上で動作しており、オートメーションもそこで実行されます。Orca はこのローカルコピーを実行しなくなりました。",
"managedHostServer": "{{host}} への移行が必要",
"missedGraceWindow": "Orca が次に確認した時点で、この実行は実行漏れの猶予時間を過ぎていました。",
"targetMissing": "オートメーションのホストは登録されていないため、このオートメーションを実行する場所がありません。",
"targetReplaced": "オートメーションのホストが削除され、再登録されたため、実行するにはこのオートメーションを再度関連付ける必要があります。",
+5 -1
View File
@@ -16902,7 +16902,10 @@
"reuseLiveSession": "활성 세션 재사용",
"freshEachRun": "실행마다 새로 시작",
"precheckEnabled": "활성화됨, {{timeout}}",
"precheckNone": "없음"
"precheckNone": "없음",
"migrate": "마이그레이션",
"migrateNotice": "{{host}}이(가) 새 원격 호스트로 업그레이드되었습니다. 계속 실행하려면 이 자동화를 마이그레이션하세요.",
"needsMigration": "마이그레이션 필요"
},
"AutomationEditorDialog": {
"fb1896a5e7": "취소",
@@ -22765,6 +22768,7 @@
"noRunnableHost": "이 자동화에는 실행할 호스트가 없습니다.",
"wslMoveInProgress": "이 자동화의 프로젝트를 WSL 호스트로 옮기는 중이어서 Orca가 이번 실행을 건너뛰었습니다. 이동이 끝나면 실행이 재개됩니다.",
"wslMoveOwnedByHost": "이 자동화의 프로젝트는 이제 WSL 호스트에서 실행되며, 해당 호스트가 그곳에서 이 자동화를 실행합니다. Orca는 더 이상 이 로컬 사본을 실행하지 않습니다.",
"managedHostServer": "{{host}}(으)로 마이그레이션 필요",
"missedGraceWindow": "Orca가 다시 확인했을 때 이 실행을 보충할 수 있는 유예 시간이 이미 지나 있었습니다.",
"targetMissing": "자동화 호스트가 더 이상 등록되어 있지 않아 이 자동화를 실행할 곳이 없습니다.",
"targetReplaced": "자동화 호스트가 제거된 후 다시 등록되었으므로, 이 자동화를 실행하려면 다시 연결해야 합니다.",
+5 -1
View File
@@ -14394,7 +14394,10 @@
"reuseLiveSession": "Reutilizar sessão ativa",
"freshEachRun": "Nova a cada execução",
"precheckEnabled": "Ativada, {{timeout}}",
"precheckNone": "Nenhuma"
"precheckNone": "Nenhuma",
"migrate": "Migrar",
"migrateNotice": "{{host}} foi atualizado para um novo host remoto. Migre esta automação para que ela continue em execução.",
"needsMigration": "Requer migração"
},
"ExternalAutomationManagers": {
"e02f970595": "Nenhum gerenciador de automação externa encontrado.",
@@ -23428,6 +23431,7 @@
"noRunnableHost": "Esta automação não tem host onde ser executada.",
"wslMoveInProgress": "O projeto desta automação está sendo movido para seu host WSL, por isso o Orca ignorou esta execução. As execuções serão retomadas quando a movimentação terminar.",
"wslMoveOwnedByHost": "O projeto desta automação agora é executado em seu host WSL, que também executa esta automação. O Orca não executa mais esta cópia local.",
"managedHostServer": "Requer migração para {{host}}",
"missedGraceWindow": "Quando o Orca verificou novamente, o período de tolerância para recuperar esta execução perdida já havia expirado.",
"targetMissing": "O host da automação não está mais registrado, então esta automação não tem onde ser executada.",
"targetReplaced": "O host da automação foi removido e registrado novamente, então esta automação precisa ser vinculada novamente antes de poder ser executada.",
+5 -1
View File
@@ -18066,7 +18066,10 @@
"reuseLiveSession": "Повторно использовать активную сессию",
"freshEachRun": "Новая при каждом запуске",
"precheckEnabled": "Включена, {{timeout}}",
"precheckNone": "Нет"
"precheckNone": "Нет",
"migrate": "Перенести",
"migrateNotice": "{{host}} обновлён до нового удалённого хоста. Перенесите эту автоматизацию, чтобы она продолжала работать.",
"needsMigration": "Требуется перенос"
},
"AutomationEditorDialog": {
"fb1896a5e7": "Отмена",
@@ -23772,6 +23775,7 @@
"noRunnableHost": "У этой автоматизации нет сервера выполнения.",
"wslMoveInProgress": "Проект этой автоматизации переносится на свой сервер WSL, поэтому Orca пришлось пропустить этот запуск. Запуски возобновятся после завершения переноса.",
"wslMoveOwnedByHost": "Проект этой автоматизации теперь работает на своём сервере WSL, который выполняет эту автоматизацию там. Orca больше не запускает эту локальную копию.",
"managedHostServer": "Требуется перенос на {{host}}",
"missedGraceWindow": "При следующей проверке Orca допустимая задержка для этого пропущенного запуска уже была превышена.",
"targetMissing": "Сервер автоматизации больше не зарегистрирован, поэтому эту автоматизацию негде запускать.",
"targetReplaced": "Сервер автоматизации был удалён и зарегистрирован заново, поэтому перед запуском эту автоматизацию нужно повторно привязать.",
+5 -1
View File
@@ -17540,7 +17540,10 @@
"reuseLiveSession": "Etkin oturumu yeniden kullan",
"freshEachRun": "Her çalıştırmada yeni",
"precheckEnabled": "Etkin, {{timeout}}",
"precheckNone": "Yok"
"precheckNone": "Yok",
"migrate": "Taşı",
"migrateNotice": "{{host}} yeni bir uzak ana bilgisayara yükseltildi. Çalışmaya devam etmesi için bu otomasyonu taşıyın.",
"needsMigration": "Taşınması gerekiyor"
},
"AutomationEditorDialog": {
"fb1896a5e7": "İptal",
@@ -22999,6 +23002,7 @@
"noRunnableHost": "Bu otomasyonun çalışacağı bir sunucu yok.",
"wslMoveInProgress": "Bu otomasyonun projesi WSL ana makinesine taşınıyor. Bu nedenle Orca bu çalıştırmayı atladı. Taşıma tamamlandığında çalıştırmalar devam edecek.",
"wslMoveOwnedByHost": "Bu otomasyonun projesi artık WSL ana makinesinde çalışıyor ve bu otomasyon da orada ana makine tarafından çalıştırılıyor. Orca artık bu yerel kopyayı çalıştırmıyor.",
"managedHostServer": "{{host}} üzerine taşınması gerekiyor",
"missedGraceWindow": "Orca'nın bir sonraki kontrolünde bu çalıştırma, kaçırılan çalıştırmalar için tanınan tolerans süresini aşmıştı.",
"targetMissing": "Otomasyon sunucusu artık kayıtlı olmadığından bu otomasyonun çalışacağı bir yer yok.",
"targetReplaced": "Otomasyon sunucusu kaldırılıp yeniden kaydedildiği için bu otomasyonun çalıştırılmadan önce yeniden ilişkilendirilmesi gerekiyor.",
+5 -1
View File
@@ -17323,7 +17323,10 @@
"reuseLiveSession": "重複使用執行中的工作階段",
"freshEachRun": "每次執行都新建",
"precheckEnabled": "已啟用,{{timeout}}",
"precheckNone": "無"
"precheckNone": "無",
"migrate": "遷移",
"migrateNotice": "{{host}} 已升級為新的遠端主機。請遷移此自動化以繼續執行。",
"needsMigration": "需要遷移"
},
"AutomationEditorDialog": {
"fb1896a5e7": "取消",
@@ -22684,6 +22687,7 @@
"noRunnableHost": "此自動化沒有可供執行的主機。",
"wslMoveInProgress": "此自動化的專案正在移至其 WSL 主機,因此 Orca 略過了此次執行。移動完成後便會恢復執行。",
"wslMoveOwnedByHost": "此自動化的專案現在在其 WSL 主機上執行,自動化本身也由該主機執行。Orca 不再執行這個本機副本。",
"managedHostServer": "需要遷移到 {{host}}",
"missedGraceWindow": "Orca 再次檢查時,此次執行的補執行寬限期已過。",
"targetMissing": "自動化主機已不在註冊清單中,因此已無處執行此自動化。",
"targetReplaced": "自動化主機已被移除並重新註冊,因此必須為此自動化重新建立關聯後才能執行。",
+5 -1
View File
@@ -16902,7 +16902,10 @@
"reuseLiveSession": "复用活动会话",
"freshEachRun": "每次运行新建",
"precheckEnabled": "已启用,{{timeout}}",
"precheckNone": "无"
"precheckNone": "无",
"migrate": "迁移",
"migrateNotice": "{{host}} 已升级为新的远程主机。请迁移此自动化以继续运行。",
"needsMigration": "需要迁移"
},
"AutomationEditorDialog": {
"fb1896a5e7": "取消",
@@ -22765,6 +22768,7 @@
"noRunnableHost": "此自动化没有可运行的主机。",
"wslMoveInProgress": "此自动化的项目正在移到其 WSL 主机,因此 Orca 跳过了此次运行。移动完成后将恢复运行。",
"wslMoveOwnedByHost": "此自动化的项目现在在其 WSL 主机上运行,自动化本身也由该主机运行。Orca 不再运行此本地副本。",
"managedHostServer": "需要迁移到 {{host}}",
"missedGraceWindow": "Orca 再次检查时,此次运行的补跑宽限期已过。",
"targetMissing": "自动化主机已不在注册列表中,因此此自动化已无处运行。",
"targetReplaced": "自动化主机已被移除并重新注册,因此必须重新关联此自动化后才能运行。",
+9 -1
View File
@@ -8,6 +8,7 @@ export const AUTOMATION_RUN_FAILURE_COPY = {
"This automation's project is moving to its WSL host, so Orca skipped this run. Runs resume when the move finishes.",
wslMoveOwnedByHost:
"This automation's project now runs on its WSL host, which runs this automation there. Orca no longer runs this local copy.",
managedHostServer: 'Needs migration to {{host}}',
missedGraceWindow: 'This run was past its missed-run grace window when Orca next checked.',
targetMissing:
'The automation host is no longer registered, so this automation has nowhere to run.',
@@ -49,7 +50,10 @@ export type AutomationRunFailureCodeFields = {
export type AutomationRunFailure = { error: string } & AutomationRunFailureCodeFields
export function automationRunFailure(
errorCode: Exclude<AutomationRunFailureCode, 'projectSetupNotReady' | 'wslDistroStopped'>
errorCode: Exclude<
AutomationRunFailureCode,
'projectSetupNotReady' | 'wslDistroStopped' | 'managedHostServer'
>
): AutomationRunFailure
export function automationRunFailure(
errorCode: 'projectSetupNotReady',
@@ -59,6 +63,10 @@ export function automationRunFailure(
errorCode: 'wslDistroStopped',
params: { distro: string }
): AutomationRunFailure
export function automationRunFailure(
errorCode: 'managedHostServer',
params: { host: string }
): AutomationRunFailure
export function automationRunFailure(
errorCode: AutomationRunFailureCode,
params?: Record<string, string>
+5
View File
@@ -31,3 +31,8 @@ export function managedOrcadServerName(target: Pick<SshTarget, 'label' | 'owner'
const runtimeId = isEphemeralRuntimeSshOwner(target.owner) ? target.owner?.runtimeId : undefined
return runtimeId ? `${target.label} VM ${runtimeId.slice(-8)}` : target.label
}
/** Refusal for a new desktop automation on a host whose managed Orca server owns its automations. */
export function moveProjectToManagedHostFirst(host: string): string {
return `Move this project to ${host} first.`
}