Skip to content

fix(hub-ui-onboard): refuse the terminal question when nobody can answer it - #449

Open
antfubot wants to merge 1 commit into
mainfrom
fix/onboard-terminal-confirm
Open

antfubot wants to merge 1 commit into
mainfrom
fix/onboard-terminal-confirm

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Summary

The default onConfirm of @devframes/hub-ui-onboard asks y/N in the terminal. Under nuxi dev, the developer often cannot see or answer that question (#448). An unrelated key could answer it, or the panel waited forever on "Confirm in your terminal...".

The default question now refuses whenever nobody can answer it:

Case Before After
Another reader holds stdin in raw mode (nuxi TUI, first boot) The question hides in the TUI log. The next key, for example w, answers it. Refused at once with DF9007.
No answer arrives (nuxi plain mode after a restart, or a developer who does not look) The POST and the shared question stay open forever. Refused after 5 minutes with DF9008. The panel shows messages.refused.
Stdin is not a TTY (nuxi TUI after a restart, CI) Refused with DF9006. Unchanged. The DF9006 page now names the nuxi case.

DF9005 now tells the developer about the 5-minute limit. The limit covers only the default question. A host's own onConfirm controls its own wait.

The guide now says that the default question needs a terminal that the dev server process reads line by line. It explains why nuxi dev takes the answer away, and tells a host under such a CLI to pass onConfirm. This corrects the assumption in #445 that the nuxi fork inherits a usable stdin. The consola example no longer claims to fit a Nuxt module.

closes #448

Verification

  • pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm build pass (156 files, 1743 tests).
  • New tests: raw-mode stdin refuses at once with DF9007. No answer within 5 minutes (fake timers) refuses with DF9008 and pauses stdin again.
  • Manual check under a real PTY (script): with setRawMode(true) and a data reader, Install gets 403 in 4 ms with DF9007. Without raw mode, y still gets 202.
  • Not verified: a real nuxi dev session.

This PR was created with the help of an AI agent.

…wer it

Under nuxi, the default terminal question could be answered by an unrelated key, or stay open forever. It now refuses at once when another reader holds stdin in raw mode (DF9007), and after 5 minutes without an answer (DF9008). The guide now tells hosts under a CLI that owns the terminal to pass onConfirm.

closes #448
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
devframe Ready Ready Preview Oct 14, 2026 7:38am UTC

@github-actions

Copy link
Copy Markdown

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/devframes/devframe/449?from=github-actions[bot]

raw result

💭 analyzed by vercel-ai-gateway/anthropic/claude-sonnet-5
🕰️ 2026-10-14 07:36 UTC
🔗 head 546745e
🤖 automated by pulls.review

{
  "headSha": "546745edc9057a6cfef43df4bb0242ad79992744",
  "result": {
    "overallSummary": "Fixes `@devframes/hub-ui-onboard`'s default terminal install-confirmation so it refuses the question instead of hanging or letting an unrelated keypress answer it, when nobody can actually respond (e.g. under `nuxi dev`'s raw-mode TUI or when no answer arrives within 5 minutes). Adds two new diagnostics (DF9007, DF9008), updates tests, and rewrites the guide/error docs to explain when a host must supply its own `onConfirm`.",
    "groups": [
      {
        "key": "terminal-confirm-fix",
        "label": "Terminal confirm refusal logic",
        "summary": "Makes the default terminal `onConfirm` refuse the install question whenever nobody can actually answer it: at once when stdin is in raw mode (another program, e.g. a TUI, owns the keys), and after a 5-minute timeout when no answer arrives at all. Adds the corresponding DF9007/DF9008 diagnostics and documents the new timeout/raw-mode behavior in the public types.",
        "category": "security",
        "filePaths": [
          "packages/hub-ui-onboard/src/terminal-confirm.ts",
          "packages/hub-ui-onboard/src/diagnostics.ts",
          "packages/hub-ui-onboard/src/types.ts"
        ],
        "critical": true,
        "fileNotes": [
          {
            "path": "packages/hub-ui-onboard/src/terminal-confirm.ts",
            "text": "Core fix: checks `input.isRaw` to detect a reader (e.g. nuxi's TUI) that would otherwise swallow the question, and adds a 5-minute timer that refuses and releases the stream if nobody answers.",
            "critical": true
          }
        ]
      },
      {
        "key": "tests",
        "label": "Terminal confirm tests",
        "summary": "Adds tests covering the new raw-mode refusal (DF9007) and the 5-minute no-answer timeout (DF9008, using fake timers), verifying stdin is paused again afterward.",
        "category": "tests",
        "filePaths": [
          "packages/hub-ui-onboard/test/terminal-confirm.test.ts"
        ]
      },
      {
        "key": "docs",
        "label": "Docs and error pages",
        "summary": "Updates the guide and error reference to explain why the default terminal question needs a line-by-line readable stdin, why CLIs like `nuxi dev` can take that away, the new DF9007/DF9008 errors, and the 5-minute limit mentioned in DF9005; also drops the claim that the `consola` example fits a Nuxt module.",
        "category": "docs",
        "filePaths": [
          "docs/content/1.guide/23.hub-ui-onboard.md",
          "docs/content/6.errors/DF9005.md",
          "docs/content/6.errors/DF9006.md",
          "docs/content/6.errors/DF9007.md",
          "docs/content/6.errors/DF9008.md",
          "docs/content/8.references/6.hub-api.md"
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-10-14T07:36:50.958Z",
    "model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
    "locale": "en"
  }
}

This branch was successfully deployed

1 active deployment
Preview — 546745ed Deployed Oct 14, 2026 by vercel[bot]
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.

hub-ui-onboard: default terminal confirmation is unusable under Nuxt 5's nuxi

1 participant