Skip to content

feat(samples): run the Lit restaurant demo with the Node agent, and load .env in the Node agent - #3417

Open
parvezk wants to merge 3 commits into
a2ui-project:mainfrom
parvezk:feat/lit-node-restaurant-demo
Open

parvezk wants to merge 3 commits into
a2ui-project:mainfrom
parvezk:feat/lit-node-restaurant-demo

Conversation

@parvezk

@parvezk parvezk commented Oct 22, 2026 •

Copy link
Copy Markdown

Description

The Lit restaurant demo (samples/client/lit) only starts the Python ADK agent, so a JS/TS developer who has already run yarn install also needs Python and uv to try it. The Lit sample predates the Node restaurant agent (samples/agent/node/restaurant_finder, added in #2816), which serves the same A2A endpoint on port 10002 and has a STUB_LLM=true mode that needs no API key.

This PR wires that agent into the Lit demo and fixes .env loading for it:

  • samples/client/lit/package.json: adds demo:restaurant:node (Lit shell plus the Node agent against Gemini) and demo:restaurant:stub (Lit shell plus the Node agent with STUB_LLM=true), with matching serve:agent:restaurant:node / serve:agent:restaurant:stub scripts. The existing demo:restaurant is unchanged.
  • samples/agent/node/restaurant_finder/package.json: the README says to cp .env.example .env, but start ran node dist/src/index.js, so the .env file was never read. start now passes --env-file-if-exists=.env --env-file-if-exists=../../../.env, which picks up the sample's .env or one at the repository root. A variable already exported in the shell still wins.
  • docs/public/quickstart.md: adds a collapsed tip under Step 3 (Lit) for the two new commands.
  • samples/agent/node/restaurant_finder/README.md: documents the .env flow and the new Lit demo commands.

--env-file-if-exists needs Node 22.9 or later. CI already uses Node 22, and the Vite 8 dependency of the Lit shell already rules out Node 18.

Testing

  • yarn workspace @a2ui/agent-restaurant-node test: 5 files, 42 tests pass.
  • Checked that GEMINI_API_KEY is read from .env when it is not exported.
  • prettier --check passes on the changed files.

Pre-launch Checklist

One time:

For this PR:

  • I have updated the relevant CHANGELOG.md file.
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on a fork, I have verified that scripts/e2e_test.sh passes.

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

Copy link
Copy Markdown
Contributor

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 adds support for running the restaurant finder agent using a pure Node.js setup (both live and stub modes) without requiring Python or uv. It updates the documentation, README, and package scripts to support these new run configurations. Feedback on the changes includes a correction to the relative path for the repository root .env file in the Node agent's start command, which is currently off by one directory level.

Comment thread samples/agent/node/restaurant_finder/package.json Outdated
@github-actions github-actions Bot added the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Oct 22, 2026
@parvezk
parvezk force-pushed the feat/lit-node-restaurant-demo branch from 311863d to 4115eed Compare October 26, 2026 19:47
@parvezk
parvezk marked this pull request as ready for review October 26, 2026 19:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant