Commit Graph

1831 Commits

Author SHA1 Message Date
Clément Fiere 62919efbdc fix: distinguish archived automation runs from cancelled ones (#1860) 2026-07-24 09:50:36 +01:00
Clément Fiere 93c6987bf5 fix: strip echoed command from persisted shell output (#1898) 2026-07-24 09:48:00 +01:00
Carlos Florêncio 29c86b7fa1 feat: create local repositories from new tasks (#1849) 2026-07-23 22:30:40 +01:00
Carlos Florêncio 4a0ef3c66c feat: improve task sidebar overflow cue (#1908) 2026-07-23 22:29:49 +01:00
Clément Fiere 3d7b2f32a7 fix: resume an unarchived task's archive-cancelled and multi-repo sessions (#1905) 2026-07-23 21:25:42 +01:00
Carlos Florêncio ba8d99f33f fix(task): preserve saved panel focus on task return (#1907) 2026-07-23 21:24:37 +01:00
Carlos Florêncio 77ef32c86c feat: add simplified resource metrics display (#1904) 2026-07-23 21:24:10 +01:00
Carlos Florêncio 1f905be98f fix: support long Git worktree paths on Windows (#1878) 2026-07-23 20:21:23 +01:00
Carlos Florêncio 73bf0fb028 fix: improve session failure recovery UX (#1866) 2026-07-23 20:02:20 +01:00
Carlos Florêncio ca63861207 chore: consolidate harness delegation guidance (#1906) 2026-07-23 19:58:43 +01:00
Clément Fiere 7a044b7e02 fix(task): dedupe repository listing and close local-path create race (#1897) 2026-07-23 17:46:25 +01:00
Carlos Florêncio 8c010ebeca fix: inherit service temporary environment (#1894) 2026-07-23 17:24:54 +01:00
Carlos Florêncio 9cd0c27be0 feat: mark selected task repositories (#1881) 2026-07-23 16:32:25 +01:00
Carlos Florêncio d475cdf597 fix: scope Office agent tools and task mutations (#1867) 2026-07-23 16:31:37 +01:00
Carlos Florêncio a225fbac3e ci: harden trusted PR review evidence (#1896) 2026-07-23 16:22:50 +01:00
Carlos Florêncio 1c70495689 fix(web): restore persisted file tree expansions (#1892) 2026-07-23 15:18:19 +01:00
Carlos Florêncio 5167bb9832 feat: add external vcs file links (#1883) 2026-07-23 15:18:10 +01:00
Carlos Florêncio bfc372b4ad perf(github): speed up CI check feedback (#1882) 2026-07-23 15:08:05 +01:00
Carlos Florêncio f6007de1cb feat: move GitLab MR linking to task menus (#1868) 2026-07-23 14:46:07 +01:00
Carlos Florêncio e53fd038a8 fix(windows): list logical drives in folder picker (#1870) 2026-07-23 14:45:49 +01:00
Carlos Florêncio 5d889478ea fix(web): focus deferred clarification custom answer (#1871) 2026-07-23 14:45:18 +01:00
Carlos Florêncio edee5a03cf fix: scope PR branch failure guidance (#1873) 2026-07-23 14:45:01 +01:00
Carlos Florêncio 258896622b fix: hide workspace ownership marker (#1874) 2026-07-23 14:44:34 +01:00
Carlos Florêncio 360ae135b3 fix(web): clarify task title editing (#1875) 2026-07-23 14:44:20 +01:00
Carlos Florêncio c041dbee0e fix(orchestrator): separate office task session ownership (#1893) 2026-07-23 14:12:58 +01:00
Clément Fiere 26c38b02e1 fix(backend): publish session state_changed when archiving cancels sessions (#1891) 2026-07-23 14:08:41 +01:00
Ahmad Ragab e1008737c4 fix(web): retain enhanced prompt results (#1854) 2026-07-23 14:01:44 +01:00
João Salavisa ac6d8eb3be feat: resolve @prompt references in workflow prompts (#1865)
* feat: resolve @prompt_name saved-prompt references in workflow step prompts

Workflow step prompts, the GitHub review-watch task prompt, and the CI
auto-fix prompt now resolve "@name" references to saved custom prompts
(Settings > Prompts) at invocation time, appending the referenced
content as hidden context while keeping the mention visible - matching
how chat messages and message_task already resolve @mentions. Editing
a saved prompt now propagates to every workflow step that references
it without needing to update each step individually.

Adds a Monaco "@" completion provider to the step-prompt and
review-watch editors, alongside the existing "{{placeholder}}"
provider.

* fix: address PR review findings on prompt-reference expansion

- Make AppendReferenceExpansions idempotent: a prompt that already
  contains a previously-appended expansion block is returned unchanged,
  since the block's own "### @name" headers would otherwise be
  re-scanned as fresh mentions on a second call.
- Skip "@name" expansion entirely for CLI-passthrough sessions: their
  prompts are written raw to a PTY with no <kandev-system> stripping,
  so the hidden block would otherwise leak into the terminal verbatim.

* fix: fail safe on passthrough lookup error in startTask

A session-lookup error while resolving isPassthrough for the Kandev
MCP wrap and prompt-reference expansion previously defaulted to
false (non-passthrough), risking a hidden <kandev-system> block
leaking into a real passthrough session's PTY on a transient error.
Extracted resolveIsPassthroughForLaunch, which now fails safe by
defaulting to true (skip injection) and logs a warning.

* fix: scope expansion idempotency marker to system blocks

The idempotency guard added in a prior commit checked for the
expansion marker anywhere in the prompt, which could falsely
suppress a legitimate first-time expansion if caller-controlled
text happened to contain that literal phrase. Add
sysprompt.HasSystemMarker, mirroring the existing HasKandevContext
pattern, so the marker is only recognized inside a formatter-
produced <kandev-system> block. Also strengthens a passthrough test
assertion that didn't actually distinguish the snapshot path from
the fail-safe default.

* fix: match exact expansion-block prefix in idempotency guard

The prior scoping fix accepted the marker anywhere inside any
<kandev-system> block, which could still false-positive against an
unrelated system block (e.g. a plan-mode prefix or MCP context
wrap) that happens to mention the marker phrase without it being
the block's own content. Check for the exact literal prefix this
package's formatter produces instead: the opening tag immediately
followed by the marker, with nothing in between.

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
2026-07-23 13:14:54 +01:00
João Salavisa 350dc0cd21 fix: follow session switch when moving between different-agent steps (#1879)
* fix: follow session switch when moving between different-agent steps

Moving a task to a workflow step with a different agent profile makes the
backend complete the current session and promote a new primary session for
the new agent. The chat UI was supposed to follow that swap, but the
follow-focus in handleTaskUpdated was suppressed whenever the user had
pinned the session they were on (clicking into a session pins it). The pin
was on the very session being retired, so the user stayed stranded on the
now-completed session — still showing the old agent and plan mode.

The activeSessionId === previousPrimary guard already scopes the follow to
"user is sitting on the session being replaced", so the pin should only
protect a *different* still-live session (active-session drift), never the
one being swapped away. Extract shouldFollowPrimarySwap encoding that rule.

Because it keys off task.updated's primary_session_id it is independent of
WS event ordering and does not depend on the new session row having loaded.

* fix: address review feedback on session-switch follow-focus

Scope the follow-focus fix to genuine session retirement and fix the real
root-cause race, per Greptile/Codex/CodeRabbit review:

- Revert the task.updated pin bypass. Manual "Set as Primary" swaps the
  primary without retiring the old session, so bypassing the pin there would
  yank a pinned user off a still-live session. Restore pin preservation and
  add a guard so a first-primary assignment (null previous primary) never
  steals focus.
- Fix the actual bug in the session state-transition handoff: when a retired
  session has no non-terminal successor in the per-task list yet (the switch
  promotes the new primary via task.updated before the old session's terminal
  state_changed lands), fall back to the task's authoritative primary. This
  path only runs when the active session truly reaches a terminal state, so it
  never fires for manual set-primary.

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
2026-07-23 13:13:58 +01:00
João Salavisa 0f277457e9 fix(executor): re-clone provider repos when local path is missing or not a git repo (#1876)
* fix(executor): re-clone provider repos when local path is missing or not a git repo

Previously the re-clone guard only fired when local_path was empty, so a
set-but-invalid path (e.g. deleted checkout, or relocated by the provider
clone-path/identity change) was fed straight to the worktree preparer,
which hard-failed with "repository is not a git repository" instead of
recovering.

Two-part fix:
- resolveTaskRepoInfo now also re-clones when local_path exists but isn't
  a valid git checkout (new isLocalGitRepo helper), self-healing on next
  launch.
- validateWorktreeRequest now fails the "Validate repository" step with an
  honest error naming the offending path when it truly isn't a git repo,
  instead of passing and cascading into a misleading "sync interrupted"
  failure downstream.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(executor): gate stale-path reclone to provider repos and cover resume + multi-repo

Restrict the stale-local-path re-clone to genuinely provider-backed repos
(SourceType != "local") so a local checkout that's temporarily missing is
never silently overwritten. Centralize the re-clone guard into a shared
ensureRepoLocalPath helper and call it from the single-repo resume path
(applyResumeRepoConfig) so resume self-heals like a fresh launch. Apply the
same non-git-path validation used by the single-repo prepare path to the
multi-repo prepareOneRepo path so a stale secondary repo fails fast with a
clear message instead of surfacing worktree.Manager's ErrRepoNotGit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 13:13:09 +01:00
José Almeida 9c16d337a2 feat(web): add global app status surface (#1869)
* feat(web): add app status bar

* feat(web): add app status bar visibility toggle

* feat(web): persist status bar item order

* fix(web): refine app status bar behavior

* fix(web): polish app status bar presentation

* test(web): split plugin slot coverage groups

* fix(web): address status surface review feedback

* fix(web): stabilize status bar overlay tests
2026-07-23 12:28:54 +01:00
José Almeida 7de788ceed feat: add cross-integration entity references (#1862)
* feat: add cross-integration entity references

* fix(web): anchor entity reference menu to composer

* fix: keep Kandev tasks under @ mentions

* fix: address entity reference review findings

* test(e2e): use option role for prompt menu

* test(e2e): update passthrough mention roles

* fix: preserve queued references and paginate Azure PRs
2026-07-23 09:03:56 +01:00
José Almeida 67507c9273 fix: prevent blank mobile task views (#1877) (#1889) 2026-07-23 08:58:05 +01:00
José Almeida d5da5d0022 fix(web): select pull request on review surface (#1857)
* fix(web): select pull request on review surface

* fix(web): address review feedback

* test(web): stabilize tablet review target assertion

* fix(web): address late review feedback

* test(web): cover PR review boundary branches
2026-07-22 17:52:58 +01:00
Carlos Florêncio 04899e1d78 fix: preserve custom layout proportions across screens (#1872) 2026-07-22 17:12:20 +01:00
Carlos Florêncio bf5fac5ffb fix(harness): stop PR polling on denied GitHub access (#1864) 2026-07-22 15:30:56 +01:00
João Salavisa 07038018ac fix(plugins): unload previous version before reloading on plugin update (#1861)
* fix(plugins): unload previous version before reloading on plugin update

The install/update path reloaded a plugin without first unloading the
previous version's registrations, unlike disable/uninstall. Because the
slot registry only appends, this ran initialize() twice and left two
main-top-bar slot entries, duplicating the plugin's widget icon until
a page refresh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(plugins): cache-bust plugin bundle import so updates re-execute

unloadPlugin(id, {evictCache: true}) drops the cached bundle registration
on install/update, but a same-tab re-import() of the identical bundle URL
returns the browser's already-evaluated ES module without re-running its
top-level registerKandevPlugin() call — leaving an updated plugin active
but missing from the UI. Key the bundle URL on the plugin's installed
version (?v=<version>) on both the frontend (toActivePlugin) and the
backend boot payload (bootActivePlugins) so a version bump forces a real
re-import while an unchanged version stays cache-friendly across boots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(plugins): update bundleUrl assertions for cache-bust query param

toActivePlugin now appends a ?v=<version> cache-busting query param to
bundleUrl; these two assertions still expected the bare path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(plugins): only evict bundle cache on install/update, not on enable

loadIfActive unconditionally evicted the cached bundle registration, which
broke the disable->enable cycle: since bundleUrl doesn't change on plain
enable, the browser's ES module cache returned the already-evaluated module
without re-running registerKandevPlugin, leaving the plugin's slots/routes
unregistered until a full page refresh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 13:45:18 +01:00
José Almeida 24f2fba183 fix: restore line expansion for multi-repo diffs (#1856)
* fix: restore line expansion for multi-repo diffs

* test: clarify review file grouping

* fix: require repository scope for ref reads
2026-07-22 09:10:54 +01:00
João Salavisa 6d5fc4794b fix(plugins): select utility agents per plugin (#1855)
* fix(plugins): select utility agents per plugin

* fix(plugins): address utility agent review feedback

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
2026-07-22 01:50:40 +01:00
João Salavisa 78cae96bb1 feat(plugins): host-side conversation reads + utility-agent invoke (#1852)
* feat(plugins): add capability-gated Host reader for conversation content

Plugins can now read historical user/agent message content over the Host
data API, gated by a new `api_read:messages` capability (ADR 0047). This
unblocks "summarize yesterday"-style plugins that the live `message.added`
bus event alone cannot serve.

- proto: `ListMessages` RPC + `Message`/`MessageFilter` on `service Host`.
- SDK: `Host.Messages() MessageReader`, Go-native `Message`/`MessageFilter`.
- host: `api_read:messages` accessor + denied reader; content sanitized via
  `sysprompt.StripSystemContent` (no raw system prompts); RFC3339 `since`/
  `until` → `InvalidArgument` on bad input.
- data: new `ListMessagesForPlugin` filtered query (session/task ids, type,
  created_at range) through the task service, never the DB file.
- tests: in-process + wire capability gating, content stripping, filter/time
  passthrough, pagination, and the SQLite query.
- docs: ADR 0047, spec, plugins-manifest, plugins-authoring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(plugins): add Host.InvokeUtilityAgent for settings-selectable utility agent

Plugins can now delegate a one-shot LLM step to an operator-configured agent,
gated by a new `agent_invoke` capability (ADR 0048), so a plugin needs no
provider API key of its own.

- setting: new `utility_agent_profile_id` user setting (Settings > System >
  Utility Agent), a profile dropdown cloned from the existing utility-agent
  path; selectable in the UI.
- capability: boolean `agent_invoke`, enforced like `state`/`secrets`.
- proto/SDK: `InvokeUtilityAgent(prompt) -> text` RPC and
  `Host.InvokeUtilityAgent(ctx, prompt)`.
- backend: reuses the sessionless host-utility inference tier (ADR 0002) via a
  thin adapter — no agent loop, no task/session/workspace; resolves the
  configured profile to (agent type, model). Unconfigured / deleted profile ->
  gRPC FailedPrecondition.
- tests: capability gating, completion path (asserts the configured profile is
  used and text returned), no-utility-agent and stale-profile error paths,
  SDK/wire round-trips, and the settings apply/trim behavior.
- docs: ADR 0048, spec, plugins-manifest, plugins-authoring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(plugins): resolve utility-agent deps live and bound message filter size

Address CI + review feedback on the host plugin capabilities:

- docs: register the new /settings/system/utility-agent route in
  docs/public/coverage.json (fixes the "Validate public docs" CI failure).
- utility agent (ADR 0048): hostUtilityMgr is wired late in boot — after
  StartActivePlugins has already spawned boot-active plugins — so snapshotting
  the utility deps in hostForPlugin stranded those hosts with nil deps and made
  InvokeUtilityAgent return Unimplemented for their lifetime. Read the deps live
  from the Service (mutex-guarded) at call time instead; add a regression test
  for late wiring reaching an already-spawned host.
- messages (ADR 0047): cap the combined session/task/type filter values at 400
  so an oversized filter fails fast with InvalidArgument instead of hitting
  SQLite's host-parameter limit at query execution; add a test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 00:20:09 +01:00
João Salavisa c4a856dc10 fix(backend): reject disallowed cross-origin state changes in CORS (#1850)
* fix(backend): reject disallowed cross-origin state changes in CORS

The CORS middleware only aborted disallowed origins on the OPTIONS
preflight, then called c.Next() for every other method. A CORS-safelisted
request (e.g. a multipart/form-data POST, which skips preflight) from a
malicious page therefore still executed the handler's side effect even
though the browser could not read the response.

Against a loopback-bound backend this is a drive-by CSRF primitive: any
web page the victim visits could POST to a mutating endpoint such as
/api/plugins/install, which unpacks and spawns the uploaded plugin binary
(RCE), with no authentication layer in front of it.

Now a disallowed cross-origin request is rejected with 403 for the
preflight and every state-changing method; only CORS-safe methods
(GET/HEAD) fall through without CORS headers, so the browser still cannot
read the response and no state is changed. No-Origin (CLI/curl) and
allowed same/loopback-origin requests are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(backend): block all disallowed cross-origin requests in CORS

Addresses review: GET is not universally side-effect-free here. Plugin
webhooks are registered for GET as well as POST
(/api/plugins/:id/webhooks/:key -> Service.InvokeWebhook), so the earlier
GET/HEAD whitelist still let a disallowed-origin browser GET trigger that
unauthenticated side effect via drive-by CSRF.

Reject every method (including GET/HEAD) with 403 for a disallowed origin.
This loses nothing legitimate: a response the browser could read
cross-origin needs CORS headers we only emit for allowed origins.
Non-browser clients (CLI/curl) and resource loads (<img>/<script>) send no
Origin and take the wildcard branch, so they are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 23:55:13 +01:00
Carlos Florêncio 7fd99c3f33 feat: complete GitLab integration parity (#1832) 2026-07-21 23:24:22 +01:00
Carlos Florêncio c1251947bf feat: add planner and worker agent orchestration (#1834) 2026-07-21 23:23:14 +01:00
Carlos Florêncio 5499eadf19 fix(github): keep draft pull requests out of merge-ready state (#1851) 2026-07-21 23:22:49 +01:00
José Almeida c645885cb5 fix(tasks): preserve inherited workspaces on subtask deletion (#1840)
* fix(tasks): preserve inherited workspaces on subtask deletion

* fix(tasks): avoid archive workspace ownership transfer

* fix(tasks): serialize shared environment handoff

* test(tasks): cover blocked shared environment handoff

* test(tasks): cover last-member environment cleanup

* fix(tasks): roll back shared environment ownership
2026-07-21 22:37:02 +01:00
Alassane 21b0003b32 fix: surface orphaned tasks in pipeline view after step deletion (#1809) 2026-07-21 21:37:50 +01:00
Carlos Florêncio be56eff1a2 fix: reset office session state when execution profile changes (#1846) 2026-07-21 21:37:08 +01:00
Carlos Florêncio ea6bfcd15f fix(web): scope and label clarification shortcuts (#1847) 2026-07-21 20:41:41 +01:00
Carlos Florêncio d144c16fc2 fix(web): reconcile dockview size before restoring layout (#1843) (#1845) 2026-07-21 19:24:11 +01:00
Carlos Florêncio 4b6d603f6d feat(github): explain repository scope (#1842) 2026-07-21 19:24:02 +01:00