Skip to content

Sunny: run the builder chat on @base44/platform/react's useChat - #87

Merged
amitbardos merged 2 commits into
mainfrom
amitb/sunny-on-use-chat
Oct 21, 2026
Merged

amitbardos merged 2 commits into
mainfrom
amitb/sunny-on-use-chat

Conversation

@amitbardos

Copy link
Copy Markdown
Contributor

Sunny's builder chat now runs on useChat from @base44/platform/react (0.5.0), the same hook Tiny Sunny moved to in #79.

What changes

  • AppBuilderSidebar.jsx follows the app live over a socket session. The 2.5s/8s polling of getConversation, the held-text "pending send" logic and the refresh-in-flight guard are gone. The hook's items, steps, status and pending prompts replace them.
  • The app's own fields (commit hashes, deploy state, name) still come from getApp. It's fetched again whenever the chat's status changes, so the Publish/ready card and the preview refresh keep working.
  • Platform proxy (boundary 3):
    • New openLiveSession action (POST /api/v1/socket-sessions with { app_ids: [appId] }). It's app-scoped and ownership-gated like every other app action. The body is a session token scoped to that one app, never the access token.
    • getConversation is removed from the allow-list, since nothing calls it now.
    • base44:smoke checks that openLiveSession on another builder's app is a 404 before anything goes upstream.
  • Widgets take the hook's bound question (answer, submit, approve, decline) instead of a raw tool call. They're routed by question.kind through one QuestionWidget, and useSubmitToolInput gives way to useAnswer. A failed answer shows in the chat's error banner, which can now be dismissed.
  • Every other step renders as a ToolRow line with the hook's label. Answers to a choice question stay under its step.

Behaviour changes to check

  • Secrets "Skip" now declines the call (approve: false). Before, it approved with { skipped: true }.
  • Tool rows no longer expand to show raw arguments and results, because the hook's steps don't carry them.
  • The composer clears on send, and the prompt shows faded until Base44 confirms it. Sending is still only allowed when the chat is ready or error.
  • Hidden messages: the hook doesn't filter messages Base44 marks hidden, which the old poll did.

Not in this PR

sendMessage and submitToolCallInput still wait up to 120s in the proxy (BUILDER_TIMEOUT_MS). The hook only needs them to resolve once Base44 accepts the request, so a long turn can still end in a spurious timeout error, as it can today.

Tested

  • npm run typecheck, and ESLint on the changed files.
  • npm run base44:smoke: all checks pass, including the new openLiveSession gate.
  • Sunny loads locally with no runtime errors. Not tested against Base44: the local root .env has no Base44 token, so the live chat, questions and the ready card haven't been run.

🤖 Generated with Claude Code

AppBuilderSidebar follows the app live over a socket session instead of
polling getConversation. The proxy gains openLiveSession, app-scoped and
ownership-gated like every other app action, and drops getConversation,
which nothing calls now. getApp is fetched again on each change of the
chat's status, for the commit and deploy fields the chat doesn't carry.

The widgets take the hook's bound question (answer, submit, approve,
decline) instead of a raw tool call, through one QuestionWidget switch;
useSubmitToolInput gives way to useAnswer. A secrets Skip is now a decline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for sunny44-builder ready!

Name Link
🔨 Latest commit f70a51c
🔍 Latest deploy log https://app.netlify.com/projects/sunny44-builder/deploys/6ad8b229335f0bb18c3c8cd7
😎 Deploy Preview https://deploy-preview-87--sunny44-builder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base44-platform-starter ready!

Name Link
🔨 Latest commit f70a51c
🔍 Latest deploy log https://app.netlify.com/projects/base44-platform-starter/deploys/6ad8b229b67682a059360396
😎 Deploy Preview https://deploy-preview-87--base44-platform-starter.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…rows

- An unconfigured bridge showed a spinner forever outside the embedded
  view, left from the OAuth connect flow. Both views now say app building
  isn't configured, with Check again.
- The chat scrolled to the bottom on every live update, so a running turn
  pulled a reader back down. It now follows only while the user is at the
  bottom; scrolling up stops it, reaching the bottom or sending resumes it.
- Steps expand again, showing what useChat keeps of a tool call: the tool
  and the files it touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amitbardos
amitbardos merged commit fdb22c9 into main Oct 21, 2026
8 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.

1 participant