Skip to content

fix(orchestration): repair main build after #4249/#4430 squash-merge#4432

Closed
senamakel wants to merge 3 commits into
tinyhumansai:mainfrom
senamakel:fix/4249-orchestration-checkpointer-build
Closed

fix(orchestration): repair main build after #4249/#4430 squash-merge#4432
senamakel wants to merge 3 commits into
tinyhumansai:mainfrom
senamakel:fix/4249-orchestration-checkpointer-build

Conversation

@senamakel

@senamakel senamakel commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Problem

The two PRs were mutually incompatible at the seam and merged in an order that landed the pre-integration state on main. cargo check on main fails with:

  • E0432: unresolved import crate::openhuman::tinyagents::SqlRunLedgerCheckpointer (orchestration/graph/mod.rs, orchestration/ops.rs test) — the type was removed by the migration.
  • E0308: mismatched types ×2 (agent_registry/agents/loader.rs:294,300) — bare fn where Option<fn()->AgentGraph> is expected.

These fixes were prepared while resolving the migration branch's conflicts but did not reach main because the PR squash-merged at the pre-fix commit.

Solution

  • agent_registry/agents/loader.rs: wrap the two orchestration graph_fn entries in Some(...).
  • orchestration/graph/mod.rs, orchestration/ops.rs (test), orchestration/graph/state.rs (doc): drive the wake graph's durable checkpoints through the crate SqliteCheckpointer at a dedicated {workspace}/orchestration_checkpoints.db, mirroring agent_orchestration/delegation.rs. Pre-swap in-flight wake graphs simply expire (orphaned tasks reconciled at boot per 07.2).

Verified: main + this fix compiles clean (both Cargo worlds); 366 tests pass across the touched areas (orchestration::*, agent_registry::agents::loader).

Submission Checklist

  • Tests added or updated — the ported ops.rs wake-cycle test now asserts persistence via SqliteCheckpointer reading the same orchestration_checkpoints.db the graph writes (happy path + the disabled/empty short-circuits are covered upstream).
  • Diff coverage ≥ 80% — the changed lines are exercised by the existing orchestration::* cycle tests (checkpointer construction + list) and the registry loader parse tests.
  • Coverage matrix updated — N/A: build-repair, no feature behaviour change.
  • All affected feature IDs listed under ## RelatedN/A: no feature IDs.
  • No new external network dependencies introduced.
  • Manual smoke checklist updated if this touches release-cut surfaces — N/A: internal checkpointer wiring only.
  • Linked issue closed — N/A: no dedicated issue; fixes the #4249/#4430 merge seam.

Impact

  • Restores compilation of the Rust core (openhuman) and, transitively, the Tauri host. No runtime behaviour change beyond the durable-checkpoint store location for the subconscious wake graph (orchestration_checkpoints.db instead of the retired run-ledger table).
  • No migration/compat concerns: nothing outside the retired SqlRunLedgerCheckpointer read the old table.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: fix/4249-orchestration-checkpointer-build

https://claude.ai/code/session_0137dT9i1vLjeUQZ3mj8ZAct

Summary by CodeRabbit

  • New Features

    • Added two new bundled MCP prompt resources for the frontend and reasoning orchestration wake-graph agents.
  • Bug Fixes

    • Improved orchestration checkpointing by switching to a SQLite-backed store for more reliable session persistence across restarts and long runs.
    • Fixed built-in agent registration so their graph configuration is loaded in the expected optional format.
    • Kept checkpointing behavior consistent across orchestration runs and related automated tests.
  • Performance

    • Reduced runtime snapshot cache freshness TTL from 10s to 2s for quicker refresh behavior.

…ansai#4430 squash-merge

The TinyAgents migration (tinyhumansai#4249) squash-merged on top of tinyhumansai#4430's subconscious
orchestration layer, but the pre-integration merge state landed: tinyhumansai#4430's wake
graph still references SqlRunLedgerCheckpointer (deleted by the migration in
04.3) and the new frontend_agent/reasoning_agent registrations pass a bare
graph_fn while the migration made that field Option<fn() -> AgentGraph>. main
does not compile (E0432 unresolved import + E0308 mismatched types).

Restore the fixes that never reached main:
- agent_registry/agents/loader.rs: wrap the two orchestration graph_fn entries
  in Some(...).
- orchestration/{graph/mod.rs, ops.rs test, graph/state.rs doc}: port the wake
  graph off the retired SqlRunLedgerCheckpointer to the crate SqliteCheckpointer
  at a dedicated orchestration_checkpoints.db, mirroring agent_orchestration/
  delegation.rs.

main + this fix compiles clean.

Claude-Session: https://claude.ai/code/session_0137dT9i1vLjeUQZ3mj8ZAct
@senamakel senamakel requested a review from a team July 3, 2026 10:54
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5b9ef41d-0755-44e5-a9bd-c17fd929f6cd

📥 Commits

Reviewing files that changed from the base of the PR and between fd65c67 and 11bd3d6.

📒 Files selected for processing (2)
  • src/openhuman/app_state/ops.rs
  • src/openhuman/mcp_server/resources.rs

📝 Walkthrough

Walkthrough

Orchestration checkpointing now uses a SQLite-backed database file, with matching documentation and test updates. The builtin agent registry now wraps two graph functions in Some(...), new bundled prompt resources were added, and the runtime snapshot TTL was shortened.

Changes

Orchestration checkpoint migration

Layer / File(s) Summary
Checkpoint store switch to SQLite
src/openhuman/orchestration/graph/mod.rs, src/openhuman/orchestration/graph/state.rs
Imports SqliteCheckpointer, opens orchestration_checkpoints.db under workspace_dir, and maps open failures in run_orchestration_graph; the checkpoint boundary comment is updated to reference the SQLite-backed boundary.
Test wiring for SQLite checkpointer
src/openhuman/orchestration/ops.rs
Updates the orchestration ops test imports and switches the full-cycle persistence test to open SqliteCheckpointer from workspace_dir/orchestration_checkpoints.db.

Agent registry and runtime resource updates

Layer / File(s) Summary
Builtin agent graph_fn wrapping
src/openhuman/agent_registry/agents/loader.rs
frontend_agent and reasoning_agent now set graph_fn as Some(...) in the builtin registry.
Agent prompt resources and snapshot TTL
src/openhuman/mcp_server/resources.rs, src/openhuman/app_state/ops.rs
Adds bundled prompt resources for frontend_agent and reasoning_agent, and reduces RUNTIME_SNAPSHOT_TTL from 10 seconds to 2 seconds with updated documentation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: rust-core, agent, bug

Suggested reviewers: M3gA-Mind

Poem

A rabbit hummed by moonlit trees,
With SQLite files and gentler breeze.
Two graph_fn hops now fit just right,
New prompts glow softly in the night.
And snapshots blink with swifter cheer 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main goal: repairing the main build after the #4249/#4430 merge.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added bug rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. labels Jul 3, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 3, 2026
rustfmt keeps the config.workspace_dir.join(...) binding on one line; satisfies
the Rust Quality (fmt) gate.

Claude-Session: https://claude.ai/code/session_0137dT9i1vLjeUQZ3mj8ZAct
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 3, 2026
With the build restored, two pre-existing failures from the tinyhumansai#4249/tinyhumansai#4430 merge
seam now run:

- mcp_server/resources.rs: tinyhumansai#4430 added frontend_agent + reasoning_agent to the
  agent BUILTINS but not to RESOURCE_CATALOG, so catalog_mirrors_builtins and
  read_resource_returns_content_for_each_subagent panicked. Add both entries
  (using each agent's prompt.md).
- app_state/ops.rs: the tinyhumansai#4249 profiling fix raised RUNTIME_SNAPSHOT_TTL to 10s,
  breaking app_state_snapshot_degrades_runtime_service_status_failures, which
  ages the process-global runtime cache out with a 2100ms sleep. Revert the TTL
  to 2s — the single-flight gate is the real stampede cure; the TTL only sets
  how often a coalesced rebuild runs, so 2s keeps status fresh and honors the
  test's age-out contract with no perf regression.

Verified: mcp_server::resources 9/9, app_state::ops 17/17, and the e2e
app_state_snapshot_degrades... 1/1 against the mock backend.

Claude-Session: https://claude.ai/code/session_0137dT9i1vLjeUQZ3mj8ZAct
@coderabbitai coderabbitai Bot added the agent Built-in agents, prompts, orchestration, and agent runtime in src/openhuman/agent/. label Jul 3, 2026
@senamakel senamakel closed this Jul 3, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Team Openhuman Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Built-in agents, prompts, orchestration, and agent runtime in src/openhuman/agent/. bug rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant