Skip to content

Add reactions for status channel changes and refactor UI handling of __error and __result channel#3745

Open
yytelliot wants to merge 28 commits intosource-academy:masterfrom
yytelliot:status-channel
Open

Add reactions for status channel changes and refactor UI handling of __error and __result channel#3745
yytelliot wants to merge 28 commits intosource-academy:masterfrom
yytelliot:status-channel

Conversation

@yytelliot
Copy link
Copy Markdown
Contributor

@yytelliot yytelliot commented Apr 6, 2026

Description

Added status handling in the frontend. Frontend state now reacts to changes in conductor evaluator status, specifically STOPPED, ERROR and RUNNING, instead of being inferred from the result and error channels.

Added a new workspace reducer setIsRunning as the manager for isRunning state. Added new reducers appendInterpreterResult and appendIntepreterError as new reducers for the result and error channel so they do not stop execution.

Note that this change will cause the status of evaluators that do not send status updates to be inaccurately reflected in the frontend. Evaluator implementers will have to update their program state accordingly so that changes in state can now be reflected on the frontend.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

How to test

  • Use updateStatus(RunnerStatus.RUNNING, true) and updateStatus(RunnerStatus.RUNNING, false)

  • See if the run button updates accordingly

  • Use updateStatus(RunnerStatus.Running, true)

  • Conduit instance should be terminated and new lines are no longer accepted in the REPL

  • UI state gets cleared: UI elements return to their state before execution

Checklist

  • I have tested this code
  • I have updated the documentation

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the dummy conductor evaluator to utilize the conductor runner API and introduces new interpreter actions for handling streaming results and execution status. Key changes include the addition of appendInterpreterResult, appendInterpreterError, and setIsRunning actions, along with corresponding reducer logic and saga updates to manage runner statuses. Review feedback suggests removing redundant properties in action creators, maintaining consistent relative import paths, and enhancing type safety by replacing any with specific error types in the workspace reducer.

@yytelliot yytelliot marked this pull request as ready for review April 6, 2026 11:52
martin-henz and others added 7 commits April 8, 2026 09:51
…ademy#3731)

* Elongate works?

* Format fix

* Fixes for TS typing

* Sentry error and possible render isLive fix

* Fix formatting error

* Sentry

---------

Co-authored-by: Richard Dominick <34370238+RichDom2185@users.noreply.github.com>
Co-authored-by: Martin Henz <henz@comp.nus.edu.sg>
@martin-henz martin-henz requested a review from RichDom2185 April 13, 2026 11:13
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24340336543

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.006%) to 40.892%

Details

  • Coverage increased (+0.006%) from the base build.
  • Patch coverage: 21 uncovered changes across 2 files (34 of 55 lines covered, 61.82%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
src/commons/sagas/WorkspaceSaga/helpers/evalCode.ts 19 0 0.0%
src/commons/workspace/WorkspaceReducer.ts 33 31 93.94%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
src/commons/sagas/WorkspaceSaga/helpers/evalCode.ts 1 42.38%

Coverage Stats

Coverage Status
Relevant Lines: 13800
Covered Lines: 6087
Line Coverage: 44.11%
Relevant Branches: 7006
Covered Branches: 2421
Branch Coverage: 34.56%
Branches in Coverage %: Yes
Coverage Strength: 28.95 hits per line

💛 - Coveralls

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.

4 participants