Repository navigation
Remove the Native backend: project roles, Manager dispatch and frozen task configurations (#1257) - #1311
Conversation
|
Reviewed head
Non-blocking, easy to include in the same push: No queue entry and no auto-merge were present on this head; I will re-review once the rebased head is pushed. |
… brings its own transport Native is no longer registered: roleHarness has no control-plane tool loop to fall back to, runAgent requires an adapter, and the Manager's event dispatch always runs its configured driver. A refused dispatch decision returns the refusal and what to do next to the Manager as submission facts. ToolTranscript, boundedBatch and runTools go with the loop. A one-time start-up migration (migration:1257:retire-native-roles) moves what still names Native to Pi, or to Process for a role whose pinned model profile needs text_json: saved role configurations, frozen task_execution_configs snapshots and role_instances (session and harness state cleared).
59cec70 to
ddd98d2
Compare
|
Rebased onto
Verification on
The PR body's verification section is updated. |
|
Re-reviewed rebased head Rebase resolution checked in the diff against the previously reviewed
All 12 required checks pass ( Queued at |
Fixes #1257
Second of the two PRs planned on the Issue (comment 7119998844), after #1307 (service assistants, merged): the project roles. After this PR there is no Native backend and no control-plane tool loop left.
What changes
Native is not registered any more (
src/roles/harness.ts). Every driver brings its own transport;roleHarnesshas norunToolsfallback (review F4). Submittingnativefor a role returnsunknown_role_harnessfrom the existing check; the role editor's backend list (from the API) no longer offers it.runAgentrequires an adapter (src/agent/runtime.ts). Without one it throwsagent_adapter_required(a plain error: every production caller passes one).runToolsis deleted, and with it the spec fields only it read (temperature,maxOutputChars).ToolTranscriptandboundedBatchinsrc/agent/tool-context.tslost their last users and go too.Manager event dispatch always runs the configured driver (
src/dispatch/manager.ts, review F2). The inline Native loop is deleted.created: false, the blockingtask_idand what to do next ("answer the person with github_write …, then ignore_event"). The harness path, which production Pi Managers already use, returned only the code and reason. The refusal now comes back as aSubmissionErrorcarrying those same facts, so nothing the Manager was told is lost.agent_turn_limit) instead of after the Native loop's single correction. This is what Pi Managers already did. The event stays pending and is retried as before.src/roles/run.ts: the request-based finalization reserve applies toprocessandpionly.text_jsonandnative_resumestay (review F5, F6):processdeclarestext_json;native_resume,native_access,native_workspace_idandpi_nativeare Pi's own identifiers.One-time start-up migration
retireNativeProjectRoles, markermigration:1257:retire-native-roles(review F3). It follows #705'sretireAcpTaskExecutionConfigs, in one transaction, and moves what still names Native:updated_by: migration:1257, arole_config_revisionsrow, an audit entry).harnessesentries are rewritten in place.task_execution_configssnapshots: V2 roles and legacy maps. The snapshot revision passes both the frozen one and the project's current one, as [需求] Claude Code 与 Codex 在项目容器内运行:原生工具、平台管理工具与容器内模型中转 #705 did. A waiting or reopened task resumes instead of stopping atunknown_role_harness.role_instances: each takes the backend of its task's migrated role, else Pi.sessionandharness_stateare cleared, so the next run rebuilds from task records.A role whose pinned model profile needs
text_jsonoutput moves toprocess, as planned; every other role moves topi. When anything moved, the start-up log gets one[migration:1257]line with the counts.Local data (read-only query of the running deployment):
pr_opened), none with atext_jsonrole;Expected start-up line after deploying:
[migration:1257] Native retired: 0 roles in 0 projects (0 to Process for text_json output, the rest to Pi), 35 frozen task configurations, 40 role instances.Docs:
docs/design/agent-and-harness-runtime.md(backend table, default backends and the #1257 migrations),docs/features/roles-and-rules.md,docs/design/testing-architecture.md,docs/design/README.mdanddocs/design/storage-and-knowledge.md.Tests
scripteddriver (平台内部调用和测试不再依赖 Native 工具循环 #1256) where they test role and task mechanics in process. Paired['native', 'process'(, 'pi')]cases keep their other halves, as planned. Where a test needed a real, listed alternative backend (role editor, saved configurations, e2e), it usesprocess.task_runs.harness, old instances shown by the console) stay as they are, since old databases keep them.agent-runtime:runAgentand gateway cases (usage records, SSE guards, model pinning and revocation, billing, retries, trace).code,reason,created,task_id,instruction); the stays-invalid case expectsagent_turn_limit.native-to-pi.test.mjs:text_jsonrole goes to Process;tool-contextandtool-result-filesunit tests: drop the transcript and batch cases; the result-file cases useboundedResult.Verification
On head
ddd98d26(base05b2e57b). It was rebased onto #1306; the conflict insrc/dispatch/manager.tskeeps #1306's expanded refusal instruction in theSubmissionErrorfacts. Earlier, #1308's newdelivery-baseline-transparencytest pinned Native and now pins the scripted driver.npm run check: passed.npm test: 2653 tests. Two sets failed in the full run, both also failing in themainbaseline under load, and both pass when run alone on this head:codex-harness: grace-window timing asserts;repository-skills-request: one case at its 90 s limit; it takes about 75 s alone.npm run test:e2e: 565 passed.b7c90cbftook 843 s, this change 557 s (2664 vs 2638 tests). Host load from other jobs differed a lot between the two runs (load average peaked at 25 vs 15), so this is not a clean comparison. On this head,npm testtook 534 s.Screenshots
Full viewports at 1440×900 and 390×1000 from the e2e harness (
scrollWidth <= innerWidthat both widths). Headless Chromium draws no popup for a<select>, so the select is given a list size to show every option in place.Project settings → 角色 → dev, Agent 后端: the options are
Pi(推荐),Claude Code,Codex,容器内 ACP,iCode,WorkSwarmandProcess; Native is gone (the list comes from the API):