Skip to content

fix(repl): don't echo an evaluator's empty result - #993

Merged
martin-henz merged 1 commit into
masterfrom
repl-no-echo-empty-result
Oct 26, 2026
Merged

martin-henz merged 1 commit into
masterfrom
repl-no-echo-empty-result

Conversation

@martin-henz

Copy link
Copy Markdown
Member

What

When the evaluator registered with set_evaluator returns no value, the Repl tab shows nothing for that run, instead of a stray null or undefined.

  • A Python None crosses the Conductor boundary as DataType.EMPTY_LIST (see repl: Python's None displays as "null" instead of "None" (DataType.EMPTY_LIST collision) #877), and rendered as null after every run of an evaluator that displays its own output (for example via repl_display).
  • hasNothingToDisplay (new, in stringify_value.ts) is true for EMPTY_LIST and VOID; __runCode skips the echo in that case. Python's REPL likewise does not echo None.
  • Unit tests for the helper, including that falsy but real values (False, 0, "") are still displayed.

Scope

This is an interim, repl-only fix for the visible symptom. It does not close #877: the None vs. empty-list collision at the module boundary and the per-language rendering (true vs True) need the DataType/stringify design discussed there. A JS null result is also no longer echoed.

Checks

yarn test, yarn tsc and yarn lint in src/bundles/repl pass. Not tried in a running Source Academy.

Refs #877

🤖 Generated with Claude Code

A Python None returned by the registered evaluator crosses the Conductor
boundary as EMPTY_LIST and was displayed as "null" after every run (#877).
Show nothing for an EMPTY_LIST or VOID result, like Python's REPL does for
None; everything the evaluator displays itself still appears.

Refs #877

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@martin-henz

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T15:15:57.306635Z 4d62d72 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 4d62d7203f

ℹ️ 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".

@martin-henz

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 4d62d7203f

ℹ️ 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".

@martin-henz
martin-henz merged commit 5de4349 into master Oct 26, 2026
12 checks passed
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.

repl: Python's None displays as "null" instead of "None" (DataType.EMPTY_LIST collision)

1 participant