Skip to content

(via tonythethompson): Use submitted recipe from useOliveStream in completion effect instead of - #263

Merged
tonythethompson merged 8 commits into
fix/olive-studio-issue-reportsfrom
macroscope/fix/olive-studio-issue-reports
Aug 13, 2026
Merged

tonythethompson merged 8 commits into
fix/olive-studio-issue-reportsfrom
macroscope/fix/olive-studio-issue-reports

Conversation

@macroscopeapp

@macroscopeapp macroscopeapp Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the completion effect in ExecutionWorkspace.tsx to use the actual submitted recipe from useOliveStream instead of rebuilding it from component state.

Changes

  • useOliveStream hook: Added runRecipeJson to the return object, exposing runRecipeJsonRef.current which contains the recipe that was actually submitted for execution.

  • ExecutionWorkspace.tsx: Updated the completion effect to consume runRecipeJson from the hook rather than reconstructing the recipe from state. Updated the dependency array to use runRecipeJson instead of state.

Motivation

Using the submitted recipe directly ensures consistency between what was executed and what is used in the completion effect. Rebuilding from state could potentially introduce inconsistencies if the state changed between submission and completion.

Note

Macroscope: Fix It For Me

  • This PR originated from this comment in Enhance model selection UI and integrate Playground output #262.
  • Since auto-merge is on, Macroscope will merge this PR after waiting for checks to pass.
  • If you'd rather not wait, you can always merge this yourself but no further action from you is currently needed.
  • You can also @mention Macroscope in this PR to request further changes.

Activity

Currently: Merged by tonythethompson

Previously
  • Not merged: conflicts
  • Waiting on checks
  • Pushed 8cd6091
  • Action failed: CI
  • Waiting on checks
  • Pushed dae8f00
  • Working on next commit...
  • Waiting on checks
  • Pushed a5e300a

Note

Use runRecipeJson state from useOliveStream to capture submitted recipe on completion

  • useOliveStream now exposes runRecipeJson as a state value (alongside the existing ref), resetting it on new run epochs and setting it when a run is initiated.
  • ExecutionWorkspace replaces its dependency on runRecipeJsonRef with the new runRecipeJson state in the completion effect that writes to the Playground store via setCapturedRunRecipe.
  • mapExecutionProviderFromRecipe in oliveRecipeHub.ts is extended to accept a JSON string directly, returning undefined on parse failure; isWebGpuRecipe in PlaygroundPanel is simplified to use this updated signature.

Macroscope summarized 72597ad.

Review in cubic

@vercel

vercel Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
olive-studio Ready Ready Preview Aug 13, 2026 5:05am

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider resetting runRecipeJsonRef to null on new executions so the completion effect always captures the recipe from the most recent run and doesn’t accidentally reuse an older value.
  • If setCapturedRunRecipe or downstream consumers expect a structured recipe object rather than a JSON string, it may be clearer for useOliveStream to expose runRecipeJson as a parsed object to avoid mixed types and repeated parsing.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider resetting `runRecipeJsonRef` to `null` on new executions so the completion effect always captures the recipe from the most recent run and doesn’t accidentally reuse an older value.
- If `setCapturedRunRecipe` or downstream consumers expect a structured recipe object rather than a JSON string, it may be clearer for `useOliveStream` to expose `runRecipeJson` as a parsed object to avoid mixed types and repeated parsing.

Fix all in Cursor


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@greptile-apps

greptile-apps Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR now carries the exact submitted recipe through React state and uses it when a completed execution is captured for Playground.

  • Adds runRecipeJson to the useOliveStream return contract while retaining the internal recipe ref.
  • Updates the completion effect to consume the state-backed submitted recipe.
  • Extends execution-provider detection to accept either parsed recipes or JSON strings.
  • Adds coverage for object, JSON-string, and invalid-recipe provider detection.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the hook return contract is coherent and the conflict markers previously breaking compilation are absent from the current code.

Important Files Changed

Filename Overview
src/components/features/execute/ExecutionWorkspace.tsx Uses the state-backed submitted recipe in the completion effect; the prior conflict markers and hook-property mismatch are resolved.
src/components/features/execute/useOliveStream.ts Exposes and maintains submitted recipe state consistently with the hook interface and current consumer.
src/components/features/playground/PlaygroundPanel.tsx Delegates JSON parsing and WebGPU provider detection to the shared recipe helper without changing invalid-input behavior.
src/lib/oliveRecipeHub.ts Safely accepts JSON strings in provider detection while preserving existing structured-object handling.
src/lib/tests/oliveRecipeHub.deriveUiState.test.ts Adds focused coverage for structured recipes, JSON strings, malformed JSON, and missing systems.

Fix All in Greploop

Reviews (11): Last reviewed commit: "perf: memoize captured WebGPU recipe che..." | Re-trigger Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 13, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review August 13, 2026 03:31

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

job.modelSource === "local" && state.localFiles.length === 0
? [{ name: job.modelIdentifier, size: 0 }]
: state.localFiles,
localFiles: state.localFiles,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🟠 High execute/BatchProcessingPanel.tsx:300

A queued local-source job with no uploaded workspace files is marked failed with “No model selected” and never runs. getPipelineValidation recognizes local models only when localFiles.length > 0, so removing the synthetic entry here makes job.modelIdentifier invisible to validation; restore that entry or validate the job identifier directly.

-    localFiles: state.localFiles,
+    localFiles:
+      job.modelSource === "local" && state.localFiles.length === 0
+        ? [{ name: job.modelIdentifier, size: 0 }]
+        : state.localFiles,
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @src/components/features/execute/BatchProcessingPanel.tsx around line 300:

A queued local-source job with no uploaded workspace files is marked failed with “No model selected” and never runs. `getPipelineValidation` recognizes local models only when `localFiles.length > 0`, so removing the synthetic entry here makes `job.modelIdentifier` invisible to validation; restore that entry or validate the job identifier directly.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 13, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review August 13, 2026 03:35

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

Comment thread src/components/features/execute/useOliveStream.ts
Comment thread src/components/features/execute/ExecutionWorkspace.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make ExecutionWorkspace use the exact recipe JSON that was submitted for an Olive run (captured by useOliveStream) when handling run completion, instead of rebuilding the recipe from potentially-changed component state.

Changes:

  • Extends useOliveStream’s public return shape to expose the submitted run recipe JSON.
  • Updates ExecutionWorkspace’s completion useEffect to consume that submitted recipe.
  • Adjusts the completion effect dependencies to avoid ref-related hooks lint issues.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/components/features/execute/useOliveStream.ts Adds runRecipeJson to the hook return contract, but currently returns a broken object shape (duplicate keys / missing field).
src/components/features/execute/ExecutionWorkspace.tsx Switches completion handling toward using the submitted recipe, but currently contains unresolved merge conflict markers and inconsistent destructuring.
Suppressed comments (1)

src/components/features/execute/ExecutionWorkspace.tsx:592

  • Unresolved merge conflict markers in this useEffect will break JSX/TS parsing. Resolve the conflict and keep a single dependency array; using runRecipeJson (returned value) avoids any ref/deps confusion and matches the PR’s intent.
  }, [executionStatus, setCapturedRunRecipe, runRecipeJsonRef]);

  // Auto-save completed diagnoses to history
  const prevDiagnosticRef = useRef(mcpDiagnostic);
  useEffect(() => {

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/features/execute/useOliveStream.ts Outdated
Comment thread src/components/features/execute/ExecutionWorkspace.tsx Outdated
Comment thread src/components/features/execute/useOliveStream.ts Outdated
greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 13, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review August 13, 2026 04:56

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 13, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review August 13, 2026 04:59

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 13, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review August 13, 2026 05:02

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

macroscopeapp Bot and others added 8 commits August 12, 2026 22:05
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…pExecutionProviderFromRecipe

- Reset runRecipeJsonRef to null at the start of handleExecuteLive and inside beginNewRunEpoch so stale recipe JSON is never captured across runs.
- Update mapExecutionProviderFromRecipe in oliveRecipeHub to handle stringified JSON input transparently.
- Simplify isWebGpuRecipe in PlaygroundPanel to delegate string parsing directly to mapExecutionProviderFromRecipe.
- Add unit tests for mapExecutionProviderFromRecipe with object, string, and invalid inputs.

Co-authored-by: Cursor <cursoragent@cursor.com>
…interface contract

- Add runRecipeJson: string | null to UseOliveStreamReturn interface and return object in useOliveStream.
- Manage runRecipeJson state in useOliveStream alongside runRecipeJsonRef to avoid render-time ref access while satisfying the hook contract.
- Update ExecutionWorkspace to consume runRecipeJson from useOliveStream in the completion effect.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@tonythethompson
tonythethompson merged commit 112c1d0 into main Aug 13, 2026
13 checks passed
@tonythethompson
tonythethompson deleted the macroscope/fix/olive-studio-issue-reports branch August 13, 2026 05:09
@linear-code

linear-code Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

OLI-97

This branch was successfully deployed

1 active deployment
Preview — 72597ad9 Deployed Aug 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants