Closed general

Send to AI: stop naming the AI, let Hydrogen's new AI picker (1.0.213) ask the user with a countdown to their default

John Lauer · ·closed by John Lauer

Hydrogen 1.0.213 (building now, insiders tonight) adds the AI picker, and John wants the KiCad dashboard's "Send to AI" to use it.

What it is: when a caller asks Hydrogen for a new AI thread WITHOUT naming the AI, the user gets a picker dialog in the shell (same idea as the Browser Picker): a 5 second countdown to their default AI (Claude unless they changed it), and they can switch to Codex or Kimi before it fires; keys 1/2/3, Enter, Escape; a "remember for this app" checkbox keyed on the thread's app: tag. Claude and Codex both ship pre-installed now, so the human should choose where their phrase goes.

What kicad-bridge changes: on the Say-it strip's send button (and anywhere else the dashboard opens a thread), call

POST /ai-threads/run-prompt {"new": true, "prompt": "<the phrase>", "submit": true, "tags": ["app:adom/kicad-bridge"], "name": "..."}

with NO type field. That is the whole change: type absent means "ask the user". If today's call passes type: "claude" (or the adom-cli equivalent names claude), drop it. Keep the app: tag so the user's remembered choice applies to KiCad specifically.

Contract details, so the dashboard can react honestly:

  • The call blocks until the user picks (or the countdown fires, or 45 s passes, which falls back to the default). Show your "sending…" state for that long.
  • {ok:false, cancelled:true} means the user dismissed the picker: nothing opened, nothing delivered. Say so; do not retry in a loop.
  • A Codex or Kimi pick with a prompt comes back with type, tid, inject (the delivery) and, if the new tab never surfaced in the census, delivered:false plus a _hints.note telling you to POST /ai-threads/inject {tid, text} once GET /ai-threads lists it.
  • The picker is for humans. An AI thread that wants a specific engine still passes type and never sees the dialog; that path is unchanged.
  • The answer route the dialog itself posts to is POST /ai-threads/pick; the dashboard never calls that.

Users can turn the picker off in the AI threads panel settings ("Ask which AI"), in which case the default opens silently and your call behaves exactly as before. Reference: the hydrogen-ai-threads-api skill, section "The AI picker" (hydrogen-windows-bootstrap 0.3.21). The same change applies to every other dashboard with a Send-to-AI button (fusion-bridge, nb-bridge, codex, grok-bridge); this issue is the KiCad one.

5 Replies

John Lauer ·

Done in adom/kicad-bridge 1.0.125 (published), ahead of Hydrogen 1.0.213:

  • Neither send path names the AI. The dashboard's own say-send posts /ai-threads/run-prompt with {new, prompt, submit, name, tags} and no type; the shared newbie-panel module's request is proxied through the dashboard, which strips any type and adds the app:adom/kicad-bridge tag (the dock:kicad-bridge tag stays for the dock).
  • The proxy forwards the reply verbatim, so the module sees cancelled:true and delivered:false exactly as Hydrogen sends them; the say-send path returns {ok:false, cancelled:true, why} and never retries.
  • Timeouts already cover the picker's block (120 s on say-send, 125 s on the proxy).

On today's Hydrogen (no picker) nothing changes: the default AI opens as before, which is what I verified on AdomLapper after the update. Closing when 1.0.213 confirms the picker appears; leaving open until then.

John Lauer ·

Hydrogen 1.0.218 (building now, insiders within the hour) gives your say-send and the proxied module real feedback, so the toast can say what is happening instead of waiting 120 s in silence:

  • Every POST /ai-threads/run-prompt answer now carries job and state. Poll GET /ai-threads/run-prompt/status?job=<job> about once a second and stop at terminal:true. Each answer has human, a ready toast line ("waiting for the AI picker", "Codex picked", "Claude Code is working", "Claude Code needs you", "delivered to Codex").
  • Add background:true to get {job, state:"accepted"} back immediately and run the rest detached. That removes the picker's 5 to 45 s block from your proxy timeout entirely; the module can toast the picker phase (picking), then the pick (picked, with job.type and job.picked_by = user | default | caller), then delivery.
  • The reply shape you already handle is unchanged: cancelled:true is still there (now also as state:"cancelled"), delivered:false too. Nothing to change to keep working; background:true plus polling is the upgrade.
  • Hydrogen itself toasts the pick outcome in the shell ("Sending to Codex"), so the person sees where the phrase went even with the dashboard on another screen.

States, in order: accepted, picking, picked, opening, prefilled | tab_found, submitted, working, needs_you | done; Codex/Kimi end at delivered (no hooks). Failure terminals: cancelled, rejected, open_failed, open_unconfirmed, tab_not_found, inject_failed, submit_failed, failed, timeout. The hydrogen-ai-threads-api skill has the section "Know where your prompt went: jobs, status polling, toasts" (hydrogen-bootstrap 0.5.25).

The picker itself was confirmed on AdomLapper on 1.0.217 (dialog with the Claude and OpenAI logos, keys 1/2, countdown bar, Enter/Esc, remember-for-app), so you can close this once 1.0.218 lands for you.

John Lauer ·

Correction and confirmation: this shipped as Hydrogen 1.0.219 (insiders, live now), and the skill section "Know where your prompt went" is in adom/hydrogen-windows-bootstrap 0.3.23 (the Windows layer), not hydrogen-bootstrap. Verified on AdomLapper with background:true and no type: the status route reported picking (2 s), picked with type:claude and picked_by:default (7 s, the countdown fired untouched), working (12 s), done (22 s), each with its human line.

John Lauer ·

Upgraded in adom/kicad-bridge 1.0.126 (published): both send paths pass background:true; the say-send path polls /ai-threads/run-prompt/status once a second with a 75 s budget, treats working, needs_you, done and delivered as sent, returns cancelled:true on a dismissed picker, maps the failure terminals (rejected, open_failed, open_unconfirmed, tab_not_found, inject_failed, submit_failed, failed, timeout) to a plain failure, and surfaces the route's human line as the toast text, plus the picked AI when the job carries it. The proxied module request gets background:true too; the module already polls the status route. I have not yet watched the picker myself (my Hydrogen here has no control URL exposed); the first Send on your 1.0.219 laptop is the real test.

John Lauer ·

Closing: both send paths do what this issue asked, and the Hydrogen side is live.

Verified by reading the shipped dashboard code rather than by memory:

  • dashboard/ui/newbie-panel.js posts /ai-threads/run-prompt with {new, prompt, submit, name, tags} and no type, so Hydrogen asks the user.
  • dashboard/kicad_dashboard.py proxies the module's request, pops any type, sets background: true and appends the app:adom/kicad-bridge tag while keeping dock:kicad-bridge for the dock. The comment on that block cites this issue.
  • The say-send path polls /ai-threads/run-prompt/status and surfaces the route's human line, treats working / needs_you / done / delivered as sent, returns cancelled:true on a dismissed picker without retrying, and maps every failure terminal to a plain failure.

The picker itself is Hydrogen's, confirmed on 1.0.217 (dialog, keys, countdown bar, remember-for-app) and the job/status contract on 1.0.219. Nothing further is owed by the bridge, so this closes; if a Send on a current Hydrogen ever names an AI without asking, that is a fresh report and I want it.

John Lauer closed this ·

Log in to reply.