Commit Graph

1136 Commits

Author SHA1 Message Date
José Almeida 041a19f060 feat: service-managed UI self-update (#1210)
* feat: add service-managed self-update

* chore: add temporary self-update test scripts

* chore: simplify temporary script markdown fences

* chore: run frontend in temporary self-update scripts

* fix: show self-update job progress after apply

* chore: add real npm self-update test script

* fix: isolate npm self-update prefix

* fix: detect npm service installs from bin shim

* chore: reset service before real npm update test

* chore: expand real npm status diagnostics

* fix: preserve service home during self-update

* fix(cli): tee self-update helper output to a log file

* fix(cli): avoid launchd bootstrap race when reloading the macOS service

* fix(backend): run macOS self-update helper once via transient launchd plist

* fix(web): show self-update progress and lock the apply button until the update lands

* fix(cli): reinstall via the kandev wrapper on Homebrew self-update

* chore: remove temp self-update test scripts

* fix(web): drop unused apply path from useUpdates hook

* fix(backend): snapshot install state once in apply preflight

* docs: align self-update docs with transient LaunchAgent flow

* chore(release): run cli bundle from apps workspace root

* fix(backend): guard against concurrent self-update applies

* fix(backend): check scheme and helper paths in self-update apply

* fix(backend): drop duplicate binary name from npx manual command

* fix(cli): allow --help for service self-update without --intent

* fix(cli): harden self-update dir perms and darwin uid resolution

* fix(web): set required POST fields last in applyUpdate

* docs: use JSON body notation for the apply endpoint

* fix(backend): expire self-update guard so a stuck helper cannot wedge apply

* refactor(cli): collapse redundant writeSync branch in self-update log
2026-06-01 17:49:15 +01:00
João Salavisa 58dd2773a2 feat(web): show inline download progress for Whisper Web model (#1228)
* feat(web): show download progress for voice mode Whisper Web model

First-time use of voice mode with the Whisper Web engine downloads
~40–240 MB of model files before the first transcription. The existing
modelLoad progress was only surfaced via the mic-button tooltip, so the
download felt silent — users couldn't tell whether it was progressing,
stuck, or how much was left.

Adds a compact inline indicator next to the mic button that renders a
percent label and a Progress bar while the model is downloading, and a
short error label when load fails. The indicator stays hidden for the
Web Speech and server-Whisper engines (which don't download models) and
clears once the model is ready.

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

* refactor(web): tidy VoiceModelLoadIndicator class names and a11y

- drop unused cn() import (single-string className doesn't need it)
- drop redundant max-w-[8rem] (w-32 already equals 8rem in tailwind)
- include modelLabel in the error state's aria-label so screen readers
  identify which model failed

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

* refactor(web): a11y improvements for VoiceModelLoadIndicator

- Replace two separate loading/error divs with a single stable role="status"
  wrapper so AT announces the loading→error transition (newly-inserted live
  regions are silently ignored by most screen readers).
- Move numeric progress to role="progressbar" + aria-valuenow/min/max on the
  inner div; removes per-tick live-region announcements.
- Drop redundant aria-live="polite" (role="status" implies it per ARIA spec).
- Align error visible text with aria-label: both now use modelLabel
  ("Whisper Base failed to load") instead of the generic string.
- Standardize tooltip wording to match indicator: "Downloading {model}…"
  instead of "Loading model…".
- Update test: error branch expects model-specific label.

* refactor(web): fix nested progressbar and clamp tooltip percent

- Remove role="progressbar" + aria-value* from the wrapper div; <Progress>
  (Radix) already renders its own progressbar — the nested node confused AT.
  Pass aria-label directly to <Progress> for the accessible name.
- Drop outer aria-label on the loading state (Radix progressbar carries it).
- Clamp tooltip percent in voice-input-button.tsx to 0–100 and handle NaN
  (mirrors clampPercent in the indicator, keeps UI consistent on edge values
  from transformers.js).
- Update test: assert aria-label via getByRole("progressbar").getAttribute().

* fix(web): guard tooltip percent against NaN; assert error aria-label in test

- Tooltip loading percent: add Number.isFinite guard so NaN from
  transformers.js progress produces "0%" instead of "NaN%".
- Test: assert aria-label on error state root matches modelLabel.

* fix(web): add w-32 to error variant to prevent layout shift on state change

Loading branch uses w-32 to hold a stable 128px slot in the toolbar.
Error branch lacked it, so the mic button shifted on loading→error transition.

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 16:28:24 +01:00
João Salavisa 1fdeda904b feat: add voice mode for chat input (#1159)
* feat: add voice mode for chat input

Adds a voice input button to the chat composer with three transcription engines:
in-browser Web Speech API, in-browser Whisper via @huggingface/transformers, and
a server-side OpenAI Whisper fallback gated on KANDEV_VOICE_OPENAI_API_KEY.

User-configurable from a new /settings/voice-mode page:
- Master on/off toggle (defaults to on; opt-out, not opt-in)
- Engine preference (auto / Web Speech / Whisper Web / Whisper Server)
- Language hint (auto-detect or BCP-47 pinned)
- Activation mode (click-to-toggle or hold-to-talk)
- Auto-send after transcription
- Whisper Web model size (tiny / base / small)
- Editable Cmd+Shift+M keyboard shortcut

Voice settings live under user_settings.voice_mode as a nested JSON object —
no schema migration. Setting changes broadcast via the existing
user.settings.updated WS event so any open chat tab updates live.

The mic button is rendered on the right of the composer alongside the send
button (round primary fill; destructive fill with pulse ring while recording).
On browsers without a usable engine (e.g. iOS Chrome over HTTP) the button
stays visible as a muted greyed icon — tapping it surfaces a toast with the
reason (typically a missing secure context).

Whisper Web runs in a Web Worker with fp16 decoder weights (avoids the
MatMulNBits scale-missing crash that q4/q8 hit on WASM). Models are pulled
from the onnx-community/* mirror and cached by transformers.js in the Cache
Storage on first use.

* fix: address voice mode PR review feedback and E2E selector clash

Bot-review fixes from #1159:
- Map http.MaxBytesError from c.FormFile to 413 instead of bare 400.
- Strip BCP-47 region suffix before passing language hint to Whisper Web.
- Recover from worker crash: terminate + null worker + reset ready flag so
  next init/transcribe creates a fresh worker instead of hanging.
- Read live store state via storeApi.getState() in voice-mode settings
  savers to avoid stale-closure clobbering concurrent settings updates.
- Detach Web Speech callbacks before abort() so trailing onend/onerror
  events don't mutate hook state after cancel().
- Spread caller init before method/body in voice-api fetch so a caller-
  supplied init can't override the multipart POST.
- Replace t.Fatalf with t.Errorf+return inside test HTTP handler goroutine
  (FailNow from non-test goroutine is unsafe).
- Add Enabled/AutoSend zeroing assertions in partial-update test so the
  bool-overwrite-on-PATCH behavior is locked in explicitly.

E2E fix:
- toolbar-overflow spec used button.rounded-full which now matches both
  the send and voice buttons (strict-mode violation). Switched to the
  submit-message-button testid for an unambiguous locator.

* fix: scope voice settings rollback + whisper worker error to changed keys

Round 2 of PR review feedback on #1159:
- voice-mode settings rollback now restores only the keys patched by the
  failing request (not the whole snapshot), preserving concurrent edits
  to unrelated voiceMode fields.
- Shortcut rollback diffs previous vs next and reverts only the changed
  keys (restore prior value or delete if absent), preserving other
  concurrent shortcut edits.
- Whisper worker error handler captures the worker reference at attach
  time and only clears refs when this.worker still matches it — a stale
  error from a previously replaced worker no longer nukes the active one.
- Update stale whisper-web-models JSDoc that still pointed at Xenova
  mirrors.

* fix: voice mode progress scale, hold-mode race, race-aware rollback

Round 3 of PR review feedback on #1159:
- Normalise Whisper progress to 0–1 in ensureWhisperClient (transformers.js
  emits 0–100, the button's display + the `ready: 1` convention expect
  0–1 — fixes the 5000% mid-download display).
- Claim driverRef synchronously at the top of finishCapture so concurrent
  pointerup + pointerleave invocations early-return instead of racing and
  clobbering a freshly-started recording's ref.
- Race-aware rollback: voice-mode and shortcut catch branches now skip
  reverting a key when latest[key] !== next[key]. A failed earlier request
  no longer overwrites a later successful save to the same key.
- Update the Worker wire-protocol comment to show onnx-community/whisper-base
  instead of the stale Xenova/* example.

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
2026-06-01 14:32:39 +01:00
João Salavisa 96871ccdea fix(orchestrator): auto-resume dormant sessions after workflow queue (#1163)
* fix(orchestrator): auto-resume dormant sessions after workflow queue

When a workflow auto-start prompt is queued after a transient ACP stream
disconnect, no live agent exists to drain the queue via agent.ready.
The prompt sits orphaned until the user manually resumes the session.

Add scheduleAutoResumeForWorkflowQueue (called from queueAutoStartPrompt)
which fires tryEnsureExecution in the background when GetExecutionBySession
shows no live agent. This drives ResumeSession → agent.boot_ready →
handleAgentBootReady → drainQueuedMessageAfterTransition — the same path
a manual resume would trigger.

Guard with s.executor == nil so existing tests that don't wire the executor
are unaffected. Add isAgentRunningFn override to mockAgentManager for
mid-sequence state transitions, and add a regression test that exercises
the full chain end-to-end.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(orchestrator): clarify scheduleAutoResumeForWorkflowQueue boundary condition

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 11:42:05 +01:00
Carlos Florêncio 3c325e9b54 fix(orchestrator): reconcile task state when user cancels turn (#1209) 2026-06-01 10:35:33 +01:00
Carlos Florêncio 6734b64b54 fix(e2e): ignore stale session state snapshots blocking idle input (#1208) 2026-06-01 10:35:07 +01:00
Carlos Florêncio d8e0507d17 fix(web): destroy terminal shells on tab close with busy confirmation (#1203) 2026-05-31 23:04:55 +01:00
github-actions[bot] 7b2d503722 release: 0.54.0 2026-05-31 21:35:11 +00:00
Carlos Florêncio 8d9bdbc822 fix(web): move CI checks link beside popover title (#1207) 2026-05-31 22:00:59 +01:00
Carlos Florêncio 3da4eac469 fix(web): collapse large PR Changes and expand Commits by default (#1206) 2026-05-31 21:37:52 +01:00
Carlos Florêncio 41ad777ec9 fix(web): render multi-level subtasks in sidebar task tree (#1204) 2026-05-31 21:37:34 +01:00
Carlos Florêncio 13e6e2d89b fix(acp): serialize wakeup prompts to prevent turn misalignment (#1202) 2026-05-31 21:12:36 +01:00
Carlos Florêncio b2faab430b fix(web): remove agent id from subagent metadata chips (#1205) 2026-05-31 20:16:26 +01:00
Carlos Florêncio 5f24349aae feat: show relative commit time on hover in changes panel (#1199) 2026-05-31 19:41:10 +01:00
Nicolas Lenepveu 1931619781 feat(web): add "(use step default)" reset to watcher profile selects (#1124) 2026-05-31 18:58:48 +01:00
Carlos Florêncio 83c800879a fix(web): stop right pane width from drifting across tasks (#1201) 2026-05-31 18:48:38 +01:00
Carlos Florêncio 4f852b7a5c feat: add PR link to CI status popover header (#1200) 2026-05-31 18:43:43 +01:00
Carlos Florêncio d76836d740 fix(web): stop changes panel flicker and restore planning chat streaming (#1197) 2026-05-31 18:43:17 +01:00
Carlos Florêncio 530915e2d4 feat(web): bubble subtask state to parent in sidebar state sort (#1194) 2026-05-31 18:43:05 +01:00
Carlos Florêncio c6b3b77c3e fix(mcp): disambiguate message_task task-not-found vs no-session error (#1186) 2026-05-31 18:42:47 +01:00
Carlos Florêncio 151bf54dec feat(health): add OS inotify resource limits health check (#1195) 2026-05-31 17:54:49 +01:00
Carlos Florêncio d1c73d2f2c feat: surface subagent task tool calls as cards in task chat (#1132) 2026-05-31 17:53:21 +01:00
Carlos Florêncio 036aee6e19 fix(agents): add Cursor auto-approve and always-allow permission UI (#1198) 2026-05-31 17:13:00 +01:00
Carlos Florêncio 700ff4199c fix(agentctl): write ACP debug logs under KANDEV_HOME_DIR (#1196) 2026-05-31 17:10:08 +01:00
Carlos Florêncio 644d428ccb fix(backend): prevent nested subtask creation for kanban tasks (depth > 1) (#1192) 2026-05-31 16:29:41 +01:00
Carlos Florêncio 0511ef3028 fix: deliver session broadcasts to focused clients during resume (#1193) 2026-05-31 14:39:15 +01:00
Carlos Florêncio af3b26b6d9 fix: track OS PIDs and clean up shells on task archive/delete (#1191) 2026-05-31 14:38:52 +01:00
Carlos Florêncio 86f756e280 feat(workflow): add set_session_mode action and preserve mode across reset (#1188) 2026-05-31 14:36:12 +01:00
Carlos Florêncio f7f4a965a1 fix(web): portal inline-code tooltip to body to prevent clipping (#1187) 2026-05-31 14:35:30 +01:00
Carlos Florêncio dea04b2bed fix(backend): close clarification overlay after agent MCP timeout and dedup retried questions (#1185) 2026-05-31 12:36:13 +01:00
Carlos Florêncio a10e81c0d7 fix: preserve whitespace in acp message chunks (#1190) 2026-05-31 12:31:56 +01:00
Carlos Florêncio d3129194d3 feat(mcp): expose task delete and archive tools to kanban agents (#1178) 2026-05-31 12:00:22 +01:00
José Almeida 36b5c682a9 fix(github): detect fork PRs by branch (#1182)
* fix(github): detect fork PRs by branch

* fix(github): align fork branch detection paths

* fix(github): skip duplicate branch PR matches

* test(github): remove stale branch owner fixtures

* test(github): remove stale PAT branch owner fixture

* fix(github): surface branch decode errors
2026-05-31 11:59:15 +01:00
José Almeida 137336de86 fix: manually drain queued chat messages after cancel (#1166)
* fix: drain queued chat messages after cancel

* fix: address queue drain review feedback

* fix: keep queued messages parked after cancel

* fix: stabilize queue drain errors

* fix: keep queue parked during cancel events

* fix: wait for lifecycle stream goroutines

* fix: address lifecycle stream review feedback
2026-05-31 11:58:01 +01:00
Carlos Florêncio 8e1f55a0ac fix: keep env prep out of partial tool history (#1189) 2026-05-31 11:48:21 +01:00
Carlos Florêncio 5e4fc9c1dd fix(workflow): exclude office workflows from settings export (#1184) 2026-05-31 11:47:25 +01:00
Carlos Florêncio 50496fd07d feat(mcp): expose workflow import tool (#1177) 2026-05-31 11:14:42 +01:00
Carlos Florêncio dcde3da74c feat: surface an inline notice when an agent turn produces no output (#1179) 2026-05-31 11:14:23 +01:00
Carlos Florêncio b16b27b3e3 fix(cli): generate brew-upgrade-resilient systemd unit (#1180) 2026-05-31 11:14:01 +01:00
Carlos Florêncio 1fa0c340d8 refactor: move workspace policy params from MCP to agentctl CLI (#1181) 2026-05-31 11:12:36 +01:00
Nicolas Lenepveu 4b05e9755d feat: throttle issue-watcher task fan-out (per-watcher cap) (#1113) 2026-05-30 23:03:27 +01:00
Nicolas Lenepveu c148282b98 fix(web): show CLI-passthrough profiles in watcher dialogs (closes #1107) (#1108) 2026-05-30 23:03:18 +01:00
Carlos Florêncio e708a76701 docs: document portable workflow import/export YAML format (#1176) 2026-05-30 22:53:57 +01:00
Carlos Florêncio 623044a8d4 feat(web): confirm session delete when closing multi-session agent tab (#1174) 2026-05-30 22:53:49 +01:00
Carlos Florêncio 0966b71f1c fix(cli): add ~/.bun/bin to service PATH (#1175) 2026-05-30 19:17:19 +01:00
Carlos Florêncio ec289c799b feat: retry transient provider 529 errors with visible backoff (#1173) 2026-05-30 19:16:49 +01:00
Carlos Florêncio d35f36ae73 fix(web): make left sidebar width global + steady monitor-switch settling (#1140) 2026-05-30 19:16:26 +01:00
Carlos Florêncio 11f5be3f84 test(e2e): add managed runner script + skill/flake-triage docs (#1170) 2026-05-30 19:16:15 +01:00
Carlos Florêncio 4da076c43e feat(backend): per-session ACP debug logs with rotation and retention (#1172) 2026-05-30 19:10:09 +01:00
irium 3fbd1280d2 fix(lifecycle): forward profile env vars on lazy-recovery createExecution (#1138) 2026-05-30 19:00:12 +01:00