Repository navigation
Fix "app is not defined" when react-node operation runners call trigger() - #16
Merged
Merged
Conversation
…e-report an unreadable task list
ahmad-ajmal
marked this pull request as ready for review
October 1, 2026 14:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the react-node blueprint, any operation runner that called
trigger(...)failed at runtime with:The runner toolbox in
server.mjswrappedapp.trigger(...), but nothing in that file is namedapp. The adapter instance isconst a2app = createA2App(...), and the Hono server ishono. The wrapper only looks up the name when it is called, sonode --checkand every boot passed. The error appeared only the first time a runner fired, which means the starter's ownrequest-triageexample was broken in every scaffolded app.Fix
toolkits/blueprint-react-node/template/server.mjs: the wrapper now callsa2app.trigger(...), and the comment next to it names the right binding.Existing apps pick this up automatically:
adapter-syncruns on every launch, copies the toolkit'sserver.mjsinto the app, and re-records the system-file hashes. No rebuild is needed.Tests
toolkits/blueprint-react-node/test/app-to-agent.test.mjs): checks that the name the runner'striggercalls is the same name thatcreateA2App(...)is assigned to. Puttingapp.triggerback fails withexpected "a2app", actual "app".conformance/harness/src/lifecycle.ts, Safe-evolve class): a new check runsa2app <app> planning tasks task_welcome request-triageagainst the booted dev instance. It then confirms that the returnedqueuedid is in the app's task queue with capabilitytriageand payload{ task: "task_welcome" }. This is the only check that goes through the runner toolbox on a running app.run()now returnsstdoutalongside the mergedout.conformance/README.mdlists the new check among the Safe-evolve checks.Verification
node toolkits/blueprint-react-node/test/app-to-agent.test.mjs: passes. It fails with the oldapp.trigger.pnpm -r build && node conformance/harness/dist/run.js: 86/86 passed. Withapp.triggerput back, the new check fails withrequest-triage exit 1: ✗ Operation "request-triage" threw: app is not defined.Not in scope
Go, Python, Rails and Rust blueprints call
store.trigger(...)on an object they hold directly. They don't look up the adapter by name later, so this bug doesn't apply to them.