Skip to content

fix(macros): follow up on member access review fixes#1156

Merged
chhoumann merged 2 commits intomasterfrom
codex/1155-review-fixes
Mar 20, 2026
Merged

fix(macros): follow up on member access review fixes#1156
chhoumann merged 2 commits intomasterfrom
codex/1155-review-fixes

Conversation

@chhoumann
Copy link
Owner

@chhoumann chhoumann commented Mar 20, 2026

This is a follow-up to the member-access change that already landed on master in commit a111204.

It contains only the remaining review-fix delta:

  • stop reusing preloaded member-access exports across macro commands
  • load the selected script after pre-commands run instead of during candidate selection
  • make the focused member-access e2e timeout less tight for CI

The previous PR #1155 was left open after the feature had already landed, so it was closed and replaced with this smaller PR to keep the review surface accurate.

Validation:

  • bun run test
  • bun run test:e2e tests/e2e/macro-member-access.test.ts

Refs #1155


Open with Devin

Summary by CodeRabbit

  • Bug Fixes

    • Deferred loading of script exports until member-access execution, improving handling of late-bound exports.
    • Clarified error message wording for member-access routing failures.
  • Tests

    • Added a test covering late-bound script member resolution.
    • Made end-to-end wait timeout configurable via an environment variable (default 15s).

@vercel
Copy link

vercel bot commented Mar 20, 2026

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

Project Deployment Actions Updated (UTC)
quickadd Ready Ready Preview Mar 20, 2026 7:47pm

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7e94bc3c-f067-44c0-9c1c-5b3d631bfcf4

📥 Commits

Reviewing files that changed from the base of the PR and between 3e7eb35 and 1a34da1.

📒 Files selected for processing (2)
  • src/engine/SingleMacroEngine.member-access.test.ts
  • src/engine/SingleMacroEngine.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/engine/SingleMacroEngine.member-access.test.ts

📝 Walkthrough

Walkthrough

Removed eager preloading of script exports from SingleMacroEngine; selection now returns lightweight candidates and member resolution loads the script on-demand via getUserScript() at execution time. Unit and e2e tests updated; e2e wait timeout made configurable via E2E_TIMEOUT_MS.

Changes

Cohort / File(s) Summary
Core Engine
src/engine/SingleMacroEngine.ts
Eliminated preloadedScripts cache and removed exportsRef/eager resolvedMember from selection flow. Selection now returns candidates without exports; tryExecuteExport performs on-demand getUserScript() and resolves members at execution time.
Unit Tests
src/engine/SingleMacroEngine.member-access.test.ts
Added test for selector-targeted script loading after pre-commands; updated an expected error message string and adjusted mock invocation expectations for late-bound loading.
E2E Tests
tests/e2e/macro-member-access.test.ts
Replaced hardcoded WAIT_OPTS timeout with numeric value derived from process.env.E2E_TIMEOUT_MS, defaulting to 15000 ms.

Sequence Diagram(s)

sequenceDiagram
    participant Runner as Runner (caller)
    participant SingleMacro as SingleMacroEngine
    participant ChoiceEngine as MacroChoiceEngine
    participant ScriptStore as getUserScript()

    Runner->>SingleMacro: runAndGetOutput("Macro::Script::member")
    SingleMacro->>ChoiceEngine: selectUserScriptCandidate(selector)
    ChoiceEngine-->>SingleMacro: candidate(s) (no exportsRef)
    SingleMacro->>SingleMacro: pick candidate
    SingleMacro->>ScriptStore: getUserScript(candidate.scriptId, app) 
    ScriptStore-->>SingleMacro: script exports (exportsRef)
    SingleMacro->>SingleMacro: resolve member from exportsRef
    SingleMacro->>Runner: return execution result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰
I waited in the burrow till the moment was right,
A script hopped out late, in the pale moonlight.
Resolved on demand, no preloads in sight,
I nibble the bytes and I dance with delight. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(macros): follow up on member access review fixes' directly describes the purpose of the PR as stated in objectives: it's a follow-up addressing remaining review fixes to member access functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/1155-review-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 20, 2026

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1a34da1
Status: ✅  Deploy successful!
Preview URL: https://185b4b21.quickadd.pages.dev
Branch Preview URL: https://codex-1155-review-fixes.quickadd.pages.dev

View logs

@chhoumann chhoumann marked this pull request as ready for review March 20, 2026 19:41
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@chhoumann chhoumann merged commit 30de256 into master Mar 20, 2026
5 checks passed
@chhoumann chhoumann deleted the codex/1155-review-fixes branch March 20, 2026 20:04
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.

1 participant