Skip to content

feat(flows): prompt bar → instant canvas with backend-driven copilot builder - #4578

Merged
senamakel merged 26 commits into
tinyhumansai:mainfrom
senamakel:feat/flows-prompt-instant-canvas
Jul 6, 2026
Merged

senamakel merged 26 commits into
tinyhumansai:mainfrom
senamakel:feat/flows-prompt-instant-canvas

Conversation

@senamakel

@senamakel senamakel commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

Summary

  • New flows prompt bar → instant canvas flow: typing a prompt instantly creates the flow and opens its canvas with the copilot already building.
  • flows_build RPC drives the workflow copilot as a first-class backend agent (retires the frontend-side builder prompts); flows_discover/flows_build now thread a copilot chat id so copilot/scout turns stream over the shared chat progress bridge.
  • Agent nodes run through the full harness tool loop via OpenHumanAgentRunner, honoring per-node agent_ref and managed model tier; agent-node inspector added on the canvas.
  • storage_* agent tools for the backend's managed S3 file storage, plus supporting integrations/client.rs and inference/provider/factory.rs provider wiring.
  • Flow-discovery + workflow-builder agents moved into the flows module; tinyflows vendor bumped for per-item execution + tool/http envelope.

Problem

  • The flows builder logic lived on the frontend as prompt strings, so the workflow copilot couldn't be driven, tested, or streamed like the rest of the agent surface.
  • Agent nodes didn't run through the real harness tool loop, so drafts couldn't exercise agent_ref nodes or per-node model tiers.
  • There was no instant path from a user prompt to a live canvas with the copilot building.

Solution

  • Moved the flow-discovery and workflow-builder agents into src/openhuman/flows/agents/ and exposed flows_build/flows_discover RPCs that run them as backend agents, streaming turns through the chat progress bridge via a threaded copilot chat id.
  • Added OpenHumanAgentRunner to execute a selected agent kind per node through the full harness tool loop, honoring managed model tier; agent-node inspector surfaces agent_ref + tier on the canvas.
  • Prompt bar now instantly creates the flow and opens the canvas with the copilot building.
  • Added a dry-run path against a mock AgentRunner so agent_ref nodes run in tests without a live backend.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
  • Diff coverage ≥ 80% — changed lines (Vitest + cargo-llvm-cov merged via diff-cover) meet the gate enforced by .github/workflows/ci-lite.yml. Run pnpm test:coverage and pnpm test:rust locally; PRs below 80% on changed lines will not merge.
  • N/A: behaviour covered by existing coverage matrix rows — no feature rows added/removed/renamed in docs/TEST-COVERAGE-MATRIX.md
  • N/A: no matrix feature IDs affected by this change
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • N/A: does not touch release-cut manual smoke surfaces
  • N/A: no linked issue — feature work tracked on the flows initiative

Impact

  • Runtime/platform impact: desktop (Tauri) + Rust core RPC surface. New flows_build/flows_discover RPC behavior and storage_* agent tools.
  • Agent nodes now execute through the full harness tool loop; per-node managed model tier is honored in completions.
  • No migrations. No new external network dependencies (E2E uses the mock backend).

Related

  • Closes:
  • Follow-up PR(s)/TODOs:

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

Linear Issue

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

Commit & Branch

  • Branch: feat/flows-prompt-instant-canvas
  • Commit SHA: d69b017c1

Validation Run

  • pnpm --filter openhuman-app format:check
  • pnpm typecheck
  • Focused tests: tests/json_rpc_e2e.rs, tests/live_flows_demo_e2e.rs, flows unit tests
  • Rust fmt/check (if changed): cargo fmt --check (pre-push pnpm rust:check passed)
  • N/A: Tauri fmt/check — no app/src-tauri Rust changes

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: prompt bar instantly creates a flow and opens its canvas with the copilot building; agent nodes run through the full harness tool loop.
  • User-visible effect: instant flow creation + streamed copilot build on the canvas.

Parity Contract

  • Legacy behavior preserved: existing flow CRUD and canvas behavior unchanged; builder logic relocated to backend without changing outputs.
  • Guard/fallback/dispatch parity checks: dry-run mock AgentRunner path mirrors live runner dispatch.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): N/A
  • Canonical PR: N/A
  • Resolution: N/A

Summary by CodeRabbit

  • New Features

    • Added a prompt-first flow for creating workflows, including direct creation from a prompt and a smoother handoff into the canvas.
    • Expanded the workflow copilot with richer build/revise/repair experiences and clearer progress display.
    • Added a new workflow template for research brief generation.
    • Introduced improved agent configuration controls, including selecting a registered agent and choosing managed model tiers.
  • Bug Fixes

    • Improved workflow-building behavior and state handling for clearer, more reliable submissions.
  • Documentation

    • Updated workflow and architecture docs to match the new creation and saving flow.

senamakel added 24 commits July 5, 2026 19:10
…as with the copilot building

Submitting the Workflows-page prompt bar now reacts immediately: it
flows_create's a blank flow named from the description, navigates to
/flows/:id with a copilotBuild seed in location.state, and the canvas
opens with the copilot panel already running the build turn (same
seeding pattern as the failed-run repair seed). Previously the builder
worked on a hidden thread while the list page sat static.

Claude-Session: https://claude.ai/code/session_01SVY5JZydeTRhEeKRG38T9F
…nt node

Implements the tinyflows `AgentRunner` capability over OpenHuman's agent
registry, so an `agent` node's `agent_ref` selects a registered agent KIND
(researcher, code_executor, crypto_agent, …) and runs the completion shaped by
that agent's persona.

- OpenHumanAgentRunner resolves + validates `agent_ref` via agent_registry,
  prepends the agent's system_prompt (and adopts its model when the node didn't
  pin one), then runs the same provider path as a plain agent turn — so the
  {json,text,raw} envelope and structured-output behavior are identical.
- Wired into build_capabilities as `agent: Some(...)`.
- First cut applies persona/model; the agent's private tool loop (run_subagent
  needs a full ParentExecutionContext a standalone flow run doesn't establish)
  is a documented follow-up — tools still come from the node's inline sub-port.
- `agent_ref` is trusted node config, never model output (injection-safe).
- Also updates the OpenHumanLlm doc to describe the new node output envelope.
- Unit tests for the request-augmentation (prepend_system_message).

Claude-Session: https://claude.ai/code/session_01SNk9tTFTDs5zUbNhaXwABy
…use the reasoning tier

The copilot previously ended builds by telling the user to go save the
proposal themselves — by design it had no persistence tool. This adds
save_workflow, a narrow carve-out from the propose-only belt: it
persists a validated graph (and optional rename) onto an ALREADY
EXISTING flow via flows_update. It still cannot create a flow, enable
or disable one, or touch the approval gate.

The instant-create prompt-bar path now delegates with a
build-and-save directive (buildSeededBuildPrompt): design the graph,
self-check with dry_run_workflow, return the proposal, then
save_workflow onto the flow the host just created. Manual copilot
revise turns may save only when the user explicitly asks; real
run_workflow tests still require explicit confirmation first.

Also moves the workflow_builder agent from the burst worker tier to
hint:reasoning — graph authoring is multi-step structured reasoning.

Claude-Session: https://claude.ai/code/session_01SVY5JZydeTRhEeKRG38T9F
Points the host at the vendored tinyflows commits this branch depends on:
env-leak fix + switch/transform nodes scope, the {json,text,raw} agent output
envelope, and the AgentRunner capability that OpenHumanAgentRunner implements.

Claude-Session: https://claude.ai/code/session_01SNk9tTFTDs5zUbNhaXwABy
…he flows module

The flow-authoring/discovery agents now live under `flows/agents/` alongside the
data model, tools, and RPCs they operate on, instead of being scattered in
`agent_registry/agents/`. Registration stays centralized: the loader's BUILTINS
slice points at the relocated modules by path — the same cross-module pattern
`reasoning_agent` already uses from `orchestration/` (include_str! + a
`crate::openhuman::flows::agents::…::prompt::build` fn ptr).

- git mv workflow_builder/ + flow_discovery/ → src/openhuman/flows/agents/
- new flows/agents/mod.rs; `pub mod agents;` in flows/mod.rs
- drop the two `pub mod` decls from agent_registry/agents/mod.rs
- loader.rs BUILTINS: repoint toml include + prompt_fn at flows::agents

No behavior change — prompt.rs uses only self-relative include_str!("prompt.md")
and absolute crate paths, so the move is mechanical. Loader registration tests
(workflow_builder / flow_discovery scope) and the agents' prompt tests pass.

Claude-Session: https://claude.ai/code/session_01SNk9tTFTDs5zUbNhaXwABy
…backend agent

Moves the builder's turn-prompt construction out of the frontend and invokes
workflow_builder directly, the same way the Flow Scout (flows_discover) runs —
instead of the frontend crafting "delegate directive" strings and relying on the
chat orchestrator to route them to the specialist.

- flows/agents/workflow_builder/builder_prompt.rs: server-side render of the
  turn brief from a structured BuilderRequest { mode, instruction, graph,
  flow_id, run_id, error, failing_node_ids }. Ports workflowBuilderPrompt.ts;
  modes create/revise/repair/build, same persistence contract (propose-only
  except build, which saves onto an existing flow). Unit tests per mode.
- flows::ops::flows_build: Agent::from_config_for_agent(config,
  "workflow_builder") + run_single under a CLI origin, 300s timeout (mirrors
  flows_discover). Captures the proposal from the run's tool history — the
  propose/revise/save tools emit a self-describing { type: "workflow_proposal" }
  result — and returns { proposal, assistant_text, error }.
- openhuman.flows_build controller schema + handler; schema-consistency tests
  updated (21 controllers).

Frontend rewire to call flows_build (retiring workflowBuilderPrompt.ts) is next.

Claude-Session: https://claude.ai/code/session_01SNk9tTFTDs5zUbNhaXwABy
…end prompts)

The Flows prompt bar and canvas copilot now run the workflow_builder agent
server-side through `openhuman.flows_build` instead of crafting "delegate
directive" prompt strings and routing them through the chat orchestrator. The
frontend sends a structured turn request; the core renders the brief and runs
the agent (like the Flow Scout).

- flowsApi: `buildWorkflow(request)` → flows_build, + `mapWorkflowProposal`
  (kept in lockstep with ChatRuntimeProvider's parse) and BuilderTurn types.
- useWorkflowBuilderChat: `send({ displayText, request })` calls buildWorkflow,
  appends the user turn + the agent's reply to the thread transcript, and sets
  the proposal in the same store slice the streamed path used (UI unchanged).
- WorkflowCopilotPanel / SuggestedWorkflows: send structured create/revise/
  repair/build requests; RepairPromptContext moved onto the panel.
- Deleted app/src/lib/flows/workflowBuilderPrompt.ts (+ test) — prompt
  construction now lives in flows/agents/workflow_builder/builder_prompt.rs.
- Tests updated to assert on the structured request; 43 pass, typecheck clean.

Claude-Session: https://claude.ai/code/session_01SNk9tTFTDs5zUbNhaXwABy
…lope

Points the host at the C2 crate commit: tool_call/http_request now default to
per-item execution (fixing the split_out fan-out silent-drop) and wrap their
output in the same {json,text,raw} envelope as the agent node. Host tool/flow
tests pass unchanged (the ToolInvoker capability still returns the raw result;
enveloping happens in the node).

Claude-Session: https://claude.ai/code/session_01SNk9tTFTDs5zUbNhaXwABy
Add gitbooks/developing/architecture/flows-on-tinyagents.md documenting how a
saved flow runs: the WorkflowGraph → validate → compile → tinyagents GraphBuilder
pipeline, the {run,nodes} run-state + merge reducer + {json,text,raw} envelope +
=-expression scope, agent-nodes-as-nested-graphs (graph within a graph), the
seven-trait capability seam, the two-layer security model (outer Workflow
origin/autonomy gate, inner agent ToolScope/sandbox gate, trusted-config
agent_ref), the one-trigger model with host-side multi-trigger via bus
subscribers, and builder/scout/executor all on one harness. Three Mermaid
diagrams (run pipeline, nested agent node, discover→build→save→run lifecycle).
Link it into gitbooks/SUMMARY.md.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
Add the "Research brief (Opus plans, Sonnet drafts)" curated template:
manual trigger ({topic}) -> reasoning-v1 agent "planner" (output_parser
schema -> {plan, angle}) -> chat-v1 agent "drafter" (prompt binds
=nodes.planner.item.json.plan) -> transform shaping {topic, plan, draft}.
Exercises agent nodes with managed tiers and graph-state data passing.

Registers it in the templates index (onDemand) and adds i18n name/description
keys to en.ts plus real translations in all 13 locale files.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
…s path

The workflow_builder / flow_discovery agents moved to src/openhuman/flows/agents/
(commit 2959dcb) but mcp_server/resources.rs still include_str!'d the old
agent_registry/agents/ paths, so the lib crate failed to compile. Repoint the
two include_str! calls; no behavior change.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
…odes run

dry_run_workflow wired the sandbox with plain mock_capabilities() (agent: None),
so a draft whose agent node selects a named agent kind (agent_ref) errored on a
missing capability instead of simulating. Switch to
mock_capabilities_with_agent(MockAgentRunner) — a deterministic echo runner, no
real turn fires — so the builder can self-test drafts that use agent-kind nodes.

Adds a builder_tools test covering an agent_ref draft dry-running green.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
`OpenHumanLlm::complete` ignored a node's `config.model`, so a plain `agent`
node pinning a managed tier (`reasoning-v1` / `chat-v1`, as the Opus+Sonnet
demo template does) routed via the caller's default role instead of the pinned
tier. Add `factory::role_for_model_tier` (tier / `hint:*` -> workload role) and
consult it in `complete`: when the node pins a model, map that tier back to its
role so the completion resolves to the right managed tier (or the role's BYOK
model). `config.model` is trusted node config, never model output.

Unit tests cover the tier/alias/unknown mappings in factory_tests.rs.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
OpenHumanAgentRunner::run_agent applied only a registered agent's persona/model
over a bare OpenHumanLlm::complete — no tool loop, no sandbox (documented as a
first cut). Rewrite it to route by agent_ref:

- Harness path (agent_ref names a harness AgentDefinition): build a real session
  agent (Agent::from_config_for_agent + set_agent_definition_name) and drive one
  run_single — the full tool loop. The definition's ToolScope / sandbox_mode /
  max_iterations govern the turn, so an agent node gains its curated toolset with
  no graph change. This is the same harness pattern flows_build / flows_discover /
  cron use: a nested tinyagents graph (the agent turn) inside the flow graph.
- Fallback path (only a custom AgentRegistryEntry): keep the persona-shaping
  single completion, so custom agents don't regress.

Details:
- node_request_to_prompt maps the node request (prompt or flattened messages)
  to run_single's single message; structured-output nodes append JSON steering.
- Model precedence: node config.model > entry model > definition default. The
  managed tier is normalised to the hint:<role> form the session builder routes
  on (bare tiers otherwise fall through to chat) and applied cron-style on a
  cloned Config's default_model — no new Agent setter API.
- Turn is bounded by clamp(timeout_secs, 10..=600).unwrap_or(240). No new origin
  wrapper: the engine future already runs under the flow's Workflow origin, so
  the autonomy tier + approval gate apply and the definition's ToolScope/sandbox
  is the inner gate. agent_ref stays trusted-config-only.
- Result mirrors OpenHumanLlm: parsed JSON for structured nodes, else
  { text, agent_ref }; the vendor agent node folds it into { json, text, raw }.

Adds tinyflows unit tests: route selection (harness vs custom fallback), model
precedence + tier→hint normalisation, prompt mapping, timeout clamp, structured
steering, and result shaping.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
flows_build and flows_discover now accept an optional thread_id (+ request_id,
uuid-generated when absent). When a thread is attached, the builder/scout turn's
AgentProgress is bridged onto the web-channel socket keyed by that thread —
text/thinking/tool deltas, the propose_workflow proposal card, and a terminal
chat_done/chat_error — exactly like an interactive chat turn (blueprint:
task_dispatcher/executor.rs). The blocking {proposal, assistant_text} return is
unchanged, so CLI/tests keep the headless path. New FlowStreamTarget helper +
unit tests for param plumbing and schema exposure.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
Pass the copilot's dedicated chat thread id through to the flows_build /
flows_discover RPC params (the Phase B streaming param convention) so the
builder/scout turn streams its text/thinking/tool events onto that thread
and the shared chat pane can render them live. Omitting the id preserves
the existing headless behaviour.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
…ipt)

useWorkflowBuilderChat now passes its dedicated thread id into flows_build
so the builder turn streams onto that thread. The global ChatRuntimeProvider
owns the transcript — it appends the final assistant message on chat_done
and fills streamingAssistantByThread / toolTimelineByThread — so the hook
stops manually appending the agent reply (it would double it) and only
appends the local user turn. The hook now also exposes toolTimeline +
liveResponse read back from the runtime's per-thread streamed state.

WorkflowCopilotPanel binds those into the shared ToolTimelineBlock (tool
cards + streaming reply) and shows a live agent bubble in the pre-tool
phase, replacing the bespoke thinking-only indicator. The proposal diff
accept/reject flow and shared ChatComposer are unchanged.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
… the canvas

New AgentNodeInspector surfaces an agent node's two harness knobs inside the
node-config drawer's AgentForm: an agent_ref picker sourced from
openhuman.agent_registry_list (Phase A routes an agent_ref node through the
full agent tool loop) and a managed capability-tier model picker
(reasoning-v1 / chat-v1 / agentic-v1 / burst-v1, matching the bare tier slugs
the runner + the Opus/Sonnet demo template use) with a raw-model escape
hatch. It replaces AgentForm's hint-slug model field. Fetch failures degrade
to inherit-only; an out-of-list agent_ref is preserved.

i18n: new agentRef* / modelManagedTiers keys added to en.ts and translated
across all 13 locales (i18n:check passes).

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
Adds an in-process forced-response queue to `mock_upstream_router`'s
chat-completions handler so agent-driven flows can script OpenAI-shape
tool calls and plain completions deterministically, mirroring the node
mock's `llmForcedResponses` without a node dependency. Entries are
optionally gated on a request-body marker so builder/scout side-calls
can't drain a scripted response out of order.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
Scripts the whole flows arc against the in-process mock via the
forced-completion FIFO: the Flow Scout emits a suggest_workflows tool
call (asserted persisted via flows_list_suggestions), the workflow_builder
emits a propose_workflow tool call carrying the Opus+Sonnet demo graph
(asserted returned as a proposal), then the saved graph runs its two
agent nodes with scripted planner (structured JSON) and drafter (text)
completions. Asserts the planner's structured plan flows into the
drafter's prompt and that the nodes route to the expected managed tiers
(reasoning-v1 / chat-v1). Disables context compaction so the builder's
tool-result history stays JSON-parseable for proposal extraction.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
Adds an #[ignore]d live e2e (gated on OPENHUMAN_LIVE_API_URL/TOKEN/USER_ID,
guard copied from live_routing_e2e) that drives the full arc against a real
backend — flows_discover → flows_build → flows_create (Opus+Sonnet demo
graph) → flows_run — and prints each step's output plus the managed tier
each agent node used. scripts/live-flows-demo.sh loads .env via load-dotenv
and runs it with --ignored --nocapture.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
Merge the type-only RepairPromptContext import into the default import
to clear the no-duplicate-imports lint error.

Claude-Session: https://claude.ai/code/session_01H6XV8tbbeRGnd15Z2vUPEF
@senamakel
senamakel requested a review from a team July 6, 2026 06:16
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1586cbc8-76f5-4587-973f-ac7aba8f5f5f

📥 Commits

Reviewing files that changed from the base of the PR and between d69b017 and 4b2600f.

⛔ Files ignored due to path filters (1)
  • app/src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • app/src/lib/flows/templates/opus-sonnet-brief.json
  • app/src/lib/i18n/bn.ts
  • app/src/lib/i18n/de.ts
  • app/src/lib/i18n/es.ts
  • app/src/lib/i18n/fr.ts
  • app/src/lib/i18n/hi.ts
  • app/src/lib/i18n/id.ts
  • app/src/lib/i18n/it.ts
  • app/src/lib/i18n/ko.ts
  • app/src/lib/i18n/pl.ts
  • app/src/lib/i18n/pt.ts
  • app/src/lib/i18n/ru.ts
  • src/openhuman/flows/agents/workflow_builder/builder_prompt.rs
  • src/openhuman/flows/ops.rs
  • tests/json_rpc_e2e.rs
📝 Walkthrough

Walkthrough

This PR replaces client-built prompt strings with structured builder-turn requests (mode/instruction/graph/flow_id) throughout the workflow-builder UI and hook layer, adds a server-side flows_build RPC with streaming support, relocates workflow_builder/flow_discovery agents under openhuman::flows::agents, adds save_workflow/list_agent_profiles tools, an agent-node runner with model-tier routing, prompt-first flow creation via createFlow, an AgentNodeInspector UI component, a new workflow template, i18n strings, docs, and end-to-end/live tests.

Changes

Frontend workflow builder UX

Layer / File(s) Summary
Prompt-first workflow creation
app/src/components/flows/WorkflowPromptBar.tsx, WorkflowPromptBar.test.tsx, app/src/lib/flows/newFlow.ts, newFlow.test.ts
Prompt bar now creates a blank flow via createFlow and navigates to the canvas with a copilotBuild seed; adds deriveWorkflowName helper.
FlowCanvasPage build-seed wiring
app/src/pages/FlowCanvasPage.tsx, __tests__/FlowCanvasPage.test.tsx
Parses location.state.copilotBuild via asCopilotBuildSeed and forwards buildSeed into FlowEditor/WorkflowCopilotPanel.
Copilot panel structured turns + streaming UI
app/src/components/flows/WorkflowCopilotPanel.tsx, .test.tsx
Sends explicit request objects (repair/build/revise) instead of prompt strings; renders ToolTimelineBlock/streaming bubble from toolTimeline/liveResponse.
useWorkflowBuilderChat hook
app/src/hooks/useWorkflowBuilderChat.ts, .test.ts
Sends structured BuilderTurnRequest via flowsApi.buildWorkflow, scopes a dedicated thread, surfaces streamed tool timeline/live response.
SuggestedWorkflows create requests
app/src/components/flows/SuggestedWorkflows.tsx, .test.tsx
"Build this" sends {mode:'create', instruction} instead of a built prompt string.
flowsApi buildWorkflow client
app/src/services/api/flowsApi.ts, .test.ts
Adds builder types, mapWorkflowProposal, buildWorkflow; discoverWorkflows gains optional threadId.
AgentNodeInspector component
app/src/components/flows/canvas/AgentNodeInspector.tsx, __tests__/*, nodeConfig/nodeConfigForms.tsx, __tests__/nodeConfigForms.test.tsx
New agent_ref/model-tier picker replaces ModelHintField in AgentForm.
Template and i18n strings
app/src/lib/flows/templates/opus-sonnet-brief.json, templates/index.ts, app/src/lib/i18n/*.ts
Adds Opus/Sonnet brief template and agent-config/template i18n strings across all locales.

Server-side flows_build pipeline, agent runner, and tools

Layer / File(s) Summary
Agent relocation + builder prompt module
src/openhuman/flows/agents/*, agent_registry/agents/loader.rs, mod.rs
Moves workflow_builder/flow_discovery into flows::agents; adds builder_prompt.rs; updates agent.toml/prompt.md persistence rules.
save_workflow / list_agent_profiles tools
src/openhuman/flows/builder_tools.rs, builder_tools_tests.rs, tools/ops.rs
New tools for persisting a graph onto an existing flow and listing registered agents; dry-run now exercises agent nodes.
flows_build/flows_discover streaming ops
src/openhuman/flows/ops.rs, ops_tests.rs, schemas.rs
Adds FlowStreamTarget, flows_build, streaming chat events, and build/discover controller schemas/handlers.
Agent-node runner + model routing
src/openhuman/tinyflows/caps.rs, tests.rs, inference/provider/factory.rs, .../mod.rs
OpenHumanAgentRunner with harness/fallback execution paths; role_for_model_tier maps tiers/hints to workload roles.
E2E/live tests, docs, vendor bump
tests/json_rpc_e2e.rs, tests/live_flows_demo_e2e.rs, scripts/live-flows-demo.sh, gitbooks/*, vendor/tinyflows
Full-arc scripted e2e test, live demo test/script, architecture docs, and vendor commit bump.

Estimated code review effort: 4 (Complex) | ~75 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Panel as WorkflowCopilotPanel
  participant Hook as useWorkflowBuilderChat
  participant API as flowsApi.buildWorkflow
  participant RPC as openhuman.flows_build
  participant Agent as workflow_builder agent

  User->>Panel: request build/revise/repair turn
  Panel->>Hook: send({mode, instruction, graph, flowId})
  Hook->>API: buildWorkflow(request, threadId)
  API->>RPC: openhuman.flows_build(params)
  RPC->>Agent: run_via_harness / build_via_registry
  Agent-->>RPC: proposal / assistant text / error
  RPC-->>API: {proposal, assistant_text, error}
  API-->>Hook: BuilderTurnResult
  Hook-->>Panel: proposal, toolTimeline, liveResponse
  Panel-->>User: render proposal / streamed UI
Loading
sequenceDiagram
  participant WorkflowPromptBar
  participant FlowsAPI as flowsApi.createFlow
  participant Router
  participant FlowCanvasPage
  participant CopilotPanel as WorkflowCopilotPanel

  WorkflowPromptBar->>FlowsAPI: createFlow(name, blankGraph)
  FlowsAPI-->>WorkflowPromptBar: flowId
  WorkflowPromptBar->>Router: navigate(/flows/:id, copilotBuild)
  Router->>FlowCanvasPage: load with location.state
  FlowCanvasPage->>FlowCanvasPage: asCopilotBuildSeed(state)
  FlowCanvasPage->>CopilotPanel: open with buildSeed
  CopilotPanel->>CopilotPanel: auto-send build request
Loading

Possibly related PRs

  • tinyhumansai/openhuman#4570: Both PRs touch useWorkflowBuilderChat/WorkflowCopilotPanel/SuggestedWorkflows, one introducing and the other refactoring the prompt/request send path away from workflowBuilderPrompt.
  • tinyhumansai/openhuman#4573: Both modify the SuggestedWorkflows "Build this" send payload and its test expectations.
  • tinyhumansai/openhuman#4574: Both update WorkflowCopilotPanel/tests around what is sent via hookState.send.

Suggested labels: feature, rust-core, agent

Suggested reviewers: M3gA-Mind, graycyrus, sanil-23

Poem

A rabbit hops through prompts turned code,
No more strings to build the road—
Structured turns now light the way,
Agents save what builders say.
🐇 Hop, build, run, and save the flow,
Sonnet drafts while Opus plans below!

🚥 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 matches the main change: prompt-bar instant canvas creation with backend-driven copilot builder.
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d69b017c1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/openhuman/flows/ops.rs Resolved
Prettier line-wraps long flows i18n values across locale files and the
opus-sonnet-brief template JSON (fixes the Frontend Checks format:check
gate). Also syncs app/src-tauri/Cargo.lock (bytes dep pulled in by the
tinyflows bump) regenerated by the pre-push rust check.

Claude-Session: https://claude.ai/code/session_01WQfYQwSLuAwmrTXLbZKv6B
@coderabbitai coderabbitai Bot added agent Built-in agents, prompts, orchestration, and agent runtime in src/openhuman/agent/. feature Net-new user-facing capability or product behavior. labels Jul 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b2600f759

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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/. feature Net-new user-facing capability or product behavior. rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant