Repository navigation
feat(agent): expand Code Mode nestable tools and remove WorkHub - #6688
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed the persisted message-origin compatibility path at ba714994235b153e441cf491b6071bee6174a060. This is a scoped finding, not a complete review of the 125-file change.
[P2] Preserve a migration/read path for existing WorkHub message origins. plugins/agent/facts/src/message.rs:35 removes WorkhubTask and WorkhubGraph from the serde-tagged MessageOrigin enum. The previous production notification writers emit these values (workhub/tasks/notifications.rs and workhub/tasks/graph/notifications.rs), so a Root that has run this feature can already contain {"kind":"workhub_task","taskId":"…"} or {"kind":"workhub_graph","graphId":"…"} in its durable messages. Removing the service does not rewrite those records.
The retained readers still deserialize them into this enum: platform/event-log/src/transcript/navigation.rs:236 (decode_origin), transcript/history.rs:696 (row header), and transcript/source.rs:250 (source lookup) propagate the serde error. Consequently, reading an affected old history row or its navigation/source metadata fails after upgrading. Please supply an explicit migration or retain a read representation for historical provenance, with a regression that writes the former variants and reads them using the upgraded history path. Replacing old fixture origins with BotWorker does not exercise that upgrade.
I reproduced both failures using the old/new production enum declarations and the actual retained decode_origin function in an isolated Rust/serde harness. Each value serializes and round-trips with the old enum, then fails the new reader with unknown variant; retained Bot/Goal and absent-origin controls pass. The harness removes the schema derive and uses an equivalent Invocation dependency; it is not a full application/database restart test. I am not claiming that every Root fails to open.
This head currently has no checks, and an actual merge with rust-preview 34f6721cf97659f011d740f712a0d3fa58a80a13 reports conflicts in owner.rs and owner/skills.rs. The author’s reported suites remain author results: I have not executed the V8/native tool-nesting suites or validated the complete WorkHub removal and upgrade.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
ba71499 to
7320edc
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
I rechecked database upgrade and historical message decoding at 7320edc8c1d48c497465b7e6d73d03b8437ed389. These are scoped compatibility findings; I have not completed the expanded 206-file review.
[P1] Existing Rust Roots are rejected by the changed migration-1 checksum. The changes to platform/event-log/migrations/0001_runtime.sql remove a persisted column and two receipt tables from the already-applied migration. schema.rs still supplies only version 1, and opening a database calls migration::run; that runner rejects an applied migration whose SQL bytes have changed. This affects an existing Root created by current rust-preview, including one that has never used WorkHub. See the inline finding for the reproduction and required forward upgrade path.
I compiled the production migration.rs unchanged in an isolated harness using the repository's rusqlite 0.41.0 and sha2 0.11.1, with the complete SQL from current base 34f6721c and this head. Installing/reopening the old schema succeeds, and installing/reopening a fresh new schema succeeds. Running the new migration list on the old database fails with migration 1 was previously applied with a different checksum. Its rollback preserves the original ledger and releases the savepoint. Only the crate-level error enum is supplied by the harness; this is an execution of the actual SQLite migration logic, not a full application restart test.
[P2] The previously reported historical-origin failure remains. This head still removes WorkhubTask and WorkhubGraph while retained history, navigation and source readers deserialize their stored JSON into MessageOrigin. I reran the old/new production enum declarations and actual retained decode_origin: both old variants round-trip with the old enum and fail the new reader with unknown variant; Bot, Goal and absent-origin controls pass. Fixing the schema upgrade alone will not migrate those message origins. This result is limited to affected historical records and does not by itself establish a failure for every Root.
The previous textual merge conflicts are resolved: an actual merge with 34f6721cf97659f011d740f712a0d3fa58a80a13 succeeds. CI 42361978253 is still running at this check; its preliminary successes do not establish the final result. I have not executed the full V8/native tool-nesting, Bot-resume or native-grant upgrade suites, validated all removed infrastructure, or upgraded a real user's database. The author-reported tests remain author results.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
| scope_id TEXT NOT NULL, | ||
| fingerprint TEXT NOT NULL, | ||
| managed INTEGER NOT NULL CHECK(managed IN (0, 1)), | ||
| authority_session_id TEXT, |
There was a problem hiding this comment.
[P1] Keep the applied migration immutable and add a forward upgrade
This changes the bytes of migration 1, which an existing Rust Root has already recorded in _sqlx_migrations. schema::initialize_connection still passes only version 1 to migration::run, and migration.rs:112 rejects its changed SHA384 checksum before the Root opens. I ran that production module with the full old/new schemas: old→old and fresh new→new pass; old→new returns migration 1 was previously applied with a different checksum. No WorkHub data is needed to reproduce it.
Please preserve the old migration and provide a new version that removes the obsolete column/tables, or an explicit validated offline upgrade, with an old-Root reopen regression. Fresh-database tests cannot cover this path.
- Enable `nestable: true` across the default installation's `ui` (`Plugin*`) and `agent` (`ModelList`, `Session*`) service tools, and switch `ScheduledTask` and Bot `SendUser` to `ToolNesting::Nestable`, while keeping protocol-hosted web search, Bot `sleep`, `cua_repl`/`cua_reset`, and `AskUserQuestion` direct-only. - Preserve JavaScript numeric semantics across `maka-js-runtime` tool, scratch-store, plugin-request, and cell-return boundaries: serialize tool/store inputs synchronously in JS before entering async ops so `exit()` and non-JSON values short-circuit cleanly, decode JSON strings with `serde_json` `js_numbers` (`json::decode_str`) so safe integers outside `i32` stay exact integers while wide integers like `2 ** 60` stay floats, and isolate REPL bridge helpers from facade bootstrap bindings. - Populate Bot `behavior` in `Owner::prepare_resume` so queue promotions and unconsumed steering continuations retain Bot tools and system prompt, and rebase headless `NativeGrant`s by full grant equality during CLI product upgrades. - Remove `maka-graph`, `workhub`, `coordinator*` composition paths, `maka-agent-ports`/`maka-event-log` plugin execution/message receipts, `BehaviorId`/`TurnOrchestration`/`orchestration_mode`, `PluginSession.managed`/`RemovalAuthority`/`ManagedSession`, retired `Plan` and `Configuration.plans` remnants, and unused workspace dependencies across Rust crates, SQLite schema, generated Plugin SDK, product bundle, CLI, ACP, Workbench, tests, and EN/ZH documentation. Generated-by: Antigravity
7320edc to
be54d7a
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
I checked the documented offline upgrade for final head be54d7a783df026d0271e3e6db7b8caca5dca878, merged as 4f3f3eaa89e2b1f9d36ecf79cc3e920fffc3b909. I read the 12-file follow-up delta and the complete 756-line linked migration script. This remains a scoped compatibility review, not a complete review of all 212 changed files.
The new offline path addresses the previously reported schema-checksum and retired-origin failures in ordinary-path fixtures. Both script checksum constants match the actual previous/final SQL. Using the supplied CLI and the complete previous schema, I checked dry-run rollback, a real migration with its default backup, preservation of unrelated package bytes/revision and message text, logical idempotence with an explicit no-backup rerun. A direct call with a controlled late failure also rolls back the preceding DDL and data changes. The production migration runner accepts the migrated fixture, and the retained origin decoder accepts the rewritten origin values. These are disposable SQLite/controlled JSON fixtures; I have not validated a real user's complete Root or restarted the full application. Existing Roots still require the documented offline migration before opening the new runtime.
[P2] Encode the backup source URI before migrating paths containing # or ?. In the migration script, backup_database opens f"file:{source_path}?mode=ro" with uri=True. A valid pathname containing URI syntax is therefore interpreted as a different SQLite URI. The CLI can report successful backup and migration while the backup is not the database being changed.
I reproduced this with disposable State Root directories named has#fragment and has?query. The unmodified CLI exits successfully and migrates the target to the 102-table new schema, but each purported backup contains zero tables, rather than the 104-table previous database. In another direct-filename check, a runtime-rust.sqlite#copy target is migrated while its backup contains a marker from the neighboring runtime-rust.sqlite, which the target never contained. An ordinary Unicode pathname backs up correctly. Replacing only the backup source construction with source_path.resolve().as_uri() + "?mode=ro" makes the same special-path controls preserve the complete old schema and ledger. Please use an encoded, read-only source URI and add a backup-content regression before recommending this destructive offline upgrade for those paths.
CI is now terminal, and the previous pending status is obsolete. The final-head run 42364787862 fails the parent/child desktop permission journey after 76.215 seconds; the merged run 42364822430 fails the same journey after 74.262 seconds. Both logs report no single control labelled “Approve child decision.” This journey was already failing on the preceding Rust base, and I have not established its cause. The earlier 7320edc8 run was cancelled. I did not execute the complete native/V8/upgrade suites locally, and these findings do not complete the remaining removal and lifecycle review.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
Summary
ui(Plugin*) andagent(ModelListand all 17Session*exports) service toolsnestable: trueinproducts/maka/bundle/src/installation.ts.ScheduledTaskand BotSendUserToolNesting::Nestableinmaka-agent-native.openai.web_search/anthropic.web_search_20250305, Botsleep,cua_repl/cua_reset, andAskUserQuestion).maka-js-runtime:store()inputs synchronously via bootstrap-capturedJSON.stringifybefore enteringasyncop wrappers soexit()inside input getters short-circuits cleanly and non-JSON inputs (BigInt, cyclic objects,Symbol) reject before dispatch without doubleJSON.parse/JSON.stringifyround-trips.op_maka_tool,op_maka_store, plugin request inputs, and Code Mode cell return values viajson::decode_str/json::decode(serde_jsonjs_numbers) so safe integers outsidei32(such as millisecond Unix timestamps passed toScheduledTask) stay exact integers while inexact wide integers (2 ** 60) stay floats.maka:repl/bootstrapso facade bootstrap declarations never collide or observe internal ops.basis.behaviorinOwner::prepare_resumeunderResumePurpose::Admitso queue promotions and unconsumed steering continuations retain Bot tools (SendUser,sleep) and the Bot system prompt.Metadata.nativeby fullNativeGrantequality inproducts/maka/cli/src/application/product/headless/publication.rsso untouched baseline routes update or prune cleanly on upgrade while user-modified grants and explicit opt-outs are preserved.maka-graph, and orphaned orchestration/managed-session/Plan infrastructure (zero compatibility branches):plugins/workhub/,plugins/agent/graph/,plugins/agent/api/src/workhub*,plugins/agent/native/src/workhub*,plugins/agent/native/src/owner/graph.rs, andplugins/shared/agent-imports.ts.maka-agent-ports::execution::{CreateRoot, ChildSession, RemoveSession, Message, Commands}andmaka-event-logplugin_message_receipts/plugin_execution_receipts),BehaviorId/TurnOrchestration/orchestration_mode/with_behavior,PluginSession.managed/session_manager/RemovalAuthority/ManagedSession,MessageOrigin::Workhub*& retiredPlan/Configuration.plansremnants,SessionKind,wh_session namespaces, multi-agent WorkHub external-agent settings synchronization, and unused workspace dependencies across Rust crates, SQLite schema,maka-schema, generated Plugin SDK declarations, product bundle/CLI/ACP/Workbench,DEPENDENCIES.rust.tsv, tests, and EN/ZH documentation.State Root Migration
No runtime compatibility shims or legacy schema branches are retained. To migrate an existing local
runtime-rust.sqliteState Root across this PR, stop any runningmakadesktop/headless Host on that State Root and run the offline migration script:migrate_maka_state_root.py)The script creates a timestamped
runtime-rust.sqlite.bak.<UTC>backup via SQLite's online backup API before committing, drops retiredplugin_message_receipts/plugin_execution_receiptstables andplugin_sessions.managed, cleans retired WorkHub/coordinator/Plan configuration & grant entries, normalizes persistedCollaborationMode/MessageBasis/MessageOrigin/ scheduled-taskExecutionTemplaterecords, updates_sqlx_migrationsversion 1's SHA-384 checksum, and verifiesPRAGMA foreign_key_check+PRAGMA quick_checkinside a single atomic transaction.Verification
node scripts/ci.mjs check format— passednode scripts/ci.mjs check licenses— passednode scripts/ci.mjs check notices— passednode scripts/ci.mjs check tooling-tests— passed (256 pass, 0 fail)node scripts/ci.mjs run product— passednode scripts/ci.mjs run contracts— passed (schema:generatecheck,plugin-sdkacceptance types, bundletsc,maka-workbenchui_types+tsc)node scripts/ci.mjs run bridge— passed (includingmaka-computer-useunit & REPL integration suites)node --test products/maka/workbench/tests/bot-transcript.test.mjs— passed (20/20)cargo clippy --locked -p maka-js-runtime -p maka-agent-facts -p maka-agent-ports -p maka-tool-catalog -p maka-agent-authority -p maka-scheduler -p maka-goal --all-targets -- -D warnings— passedcargo nextest run --locked -p maka-js-runtime -p maka-agent-facts -p maka-agent-ports -p maka-presentation -p maka-event-log -p maka-tool-catalog -p maka-tools -p maka-agent-engine -p maka-scheduler -p maka-goal -p maka-acp -p maka-agent-api -p maka-processes-native -p maka-host-runtime— passedcargo nextest run --locked -p maka-agent-native --lib -E 'test(code_mode) | test(session_tools) | test(scheduler) | test(bot) | test(checkpoints) | test(fork) | test(external) | test(terminal) | test(metrics) | test(skills) | test(file_browsing) | test(queue) | test(execution) | test(goal) | test(approval_park) | test(recall)'— passedcargo test --locked -p maka-cli --bin maka— passed (57/57, including expandedpublication::tests)cargo test --locked -p maka-cli --test integration product_composition— passedcargo test --locked -p maka-cli --test integration external_agents_ui_consent_native_catalog_cache_and_failure_isolation— passedmigrate_maka_state_root.pydry-run, real migration, backup creation, and idempotent re-run against pre-PR0001_runtime.sqlfixture — passedAI use
Select exactly one:
Tool(s) and scope: Antigravity — codebase census, 3-agent adversarial review & convergence, implementation of Code Mode tool nesting and
maka-js-runtimenumeric/boundary fixes, Bot resume & headless native-grant rebase fixes, full removal of WorkHub/maka-graphand orphaned orchestration/managed-session/Plan infrastructure across Rust/TypeScript/docs, offline State Root migration script & verification, and local test suites.Checklist
Does this PR entail a change in behavior?