Skip to content

[codex] Fix OpenTUI native render lowering#4183

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/opentui-render-indexset
Jun 3, 2026
Merged

[codex] Fix OpenTUI native render lowering#4183
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/opentui-render-indexset

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

Fix the remaining generic Perry-native OpenTUI render smoke blocker after #4150 by correcting three scoped lowering/runtime-shape issues exercised by the render path:

  • allow builtin generic Array static types to use array receiver lowering
  • route side-effect-free obj.arrayProp[index] = value through the existing IndexSet fast path when target and receiver property paths match
  • remove the invalid closure guard that made super() in a derived constructor fail when the constructor was reached through a closure-created new Cache() path

This is scoped to generic OpenTUI render/input/update/clean-teardown evidence. It does not claim actual OpenCode native completion.

#4176 comparison

I compared #4176 (addf0430271e2efa97a2e7ceea7d8f8d144e9065, crates/perry-runtime/src/proxy.rs) against the previously validated safe OpenTUI patch. #4176 is only a subset and was not sufficient for the generic OpenTUI lane:

  • the derived-constructor reducer still failed with ReferenceError: identifier is not defined
  • the property-array reducer exited 139
  • the OpenTUI renderlib reducer exited 139

So this PR keeps the complete scoped compiler-side fix instead of the unsafe exploratory PutValue route.

Validation

  • cargo fmt
  • cargo build --release -p perry
  • cargo build --release -p perry-runtime
  • cargo build --release -p perry-stdlib
  • PERRY_RUNTIME_DIR=/tmp/perry-opentui-render-pr/target/release tests/test_issue_4150_array_property_index_set.sh
  • PERRY_RUNTIME_DIR=/tmp/perry-opentui-render-pr/target/release tests/test_issue_4150_new_array_index_set.sh
  • PERRY_RUNTIME_DIR=/tmp/perry-opentui-render-pr/target/release tests/test_issue_4150_derived_constructor_arrow_new.sh
  • OpenTUI renderlib reducer: repro-perry-renderlib-drawtext.ts reached expected before/after visible buffer text
  • Generic Perry-native OpenTUI fallback smoke passed with full stdlib:
cd /Users/andrew/Documents/opentui/packages/core
PERRY_BIN=/tmp/perry-opentui-render-pr/target/release/perry \
  OTUI_PERRY_NATIVE_SMOKE_DIAGNOSTICS=1 \
  bun scripts/perry-native-smoke.ts --compile-timeout-ms 120000 --keep-temp

Observed output:

Perry-native generic OpenTUI fallback smoke passed.
Observed output: perry-native: idle -> perry-native: pressed:x
Product status: incomplete because the OpenCode TUI entrypoint was not available.

@proggeramlug proggeramlug marked this pull request as ready for review June 3, 2026 03:13
@proggeramlug proggeramlug merged commit 0ef8875 into PerryTS:main Jun 3, 2026
11 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.

2 participants