4872 Commits

Author SHA1 Message Date
kongxin
5426576fa5
fix(agents): run the calls that fit when a batch crosses a per-tool loop limit (#8267)
* fix(agents): run the calls that fit when a batch crosses a per-tool loop limit

One model response with 50 or more calls to the same tool lost every
call: the per-tool frequency check stopped the run before any of them
ran (#8214).

- A per-tool limit now drops only the calls that would reach it; the
  calls within the limit run. A response in which no call fits still
  stops the run, and the identical-call hard limit still rejects the
  whole batch.
- The capped tool stays blocked for the rest of the execution, whatever
  the frequency window counts. The cap is a record in the private
  loop_cap state channel, so it survives an approval pause, the resume's
  new run_id, a Gateway restart and context compaction. before_agent
  expires a record another run left behind, which gives a later task a
  fresh budget.
- The run is loop_capped from the first dropped call, in the run record
  and in a subagent result. A resumed run is marked again from the
  record.
- The model is told on its next call how many calls were skipped and how
  many were passed on, followed by the wrap-up instructions. The notice
  is read from the record on every model call and cleared once the model
  has answered.
- The Gateway treats loop_cap as a server-owned state channel.
- middleware:loop_detection gains the action reject_excess.

* fix(agents): count after the window eviction and keep the cap record readable

Review follow-up for #8267:

- A call reaches a per-tool limit when the window would hold that many
  calls to its tool after taking the call in and dropping its oldest
  entry, as on main. Counting before the eviction rejected a call that
  only replaced an older call to the same tool, so 49 reads, one other
  call and one more read capped read_file where main admits 49 more.
- The cap record holds only what its reader accepts. A tool whose name
  the reader would reject, or one past the record's size bound, is left
  out instead of making the next read discard every cap in the record.
  The record and its notice are still written, so the drop is explained
  and the execution stays loop_capped.
- A dropped batch is audited once per tool that reached its limit in it,
  with that tool's own count and threshold.
- Tests: a seeded comparison against a plain sliding window, the
  interleaved sequence, unnameable and overflowing records, and the
  per-tool audit rows.

* fix(agents): report a partial loop cap when the run ends, not mid-run

Review follow-up for #8267. runtime.context["stop_reason"] is read in
two ways: the worker and Goal continuation read it when the run is over,
while run-input admission, the todo middleware and end-of-graph input
handling read it mid-run as "the run is ending" and skip their checks.
A partial cap wrote it at the first dropped call, while the admitted
calls of that response still had to run, so those calls skipped the
checks:

- input that arrived during inference no longer cancelled the planned
  calls, so obsolete writes ran after a steer;
- two parallel write_todos calls both ran, each replacing the plan;
- input that arrived as the run finished was dropped.

A response with no call left is still a terminal stop and is reported
at once. A partial cap is reported to the subagent channel at once and
to the run context by after_agent, which runs after the end-of-graph
input handling; another guard's earlier reason is kept. A run that
pauses for approval no longer reports a reason; the run that resumes it
reports loop_capped when it ends.

Tests drive the three cases through real compiled graphs in the lead
chain's middleware order.

* fix(agents): undo a discarded response's loop accounting and report the guard that stopped the run

Third review follow-up for #8267.

- A response whose admitted calls another middleware discards before any
  of them runs (input admission on a steer, approval on calls it cannot
  address) no longer leaves a cap or counts toward a limit. As the next
  model call starts, the frequency window, warnings and cap record go
  back to their state before that response; caps from earlier responses
  stay. Before, a steer whose replacement needed the same tool had that
  write dropped as already capped. The undo runs in wrap_model_call, not
  a before_model hook, so no graph node is added and lead runs do not
  spend an extra super-step per turn of their recursion limit.
- A partial cap reports to both channels only when the run ends, and
  only when no other guard has given the reason it stopped. A subagent
  that a later token-budget stop ended now reports token_capped, as its
  run context does, instead of loop_capped.

Tests drive the steer cases through compiled graphs with real input
admission, including a replacement that uses the capped tool and an
earlier cap that must survive the undo, and the token-budget case sync
and async.

---------

Co-authored-by: AochenShen99 <sac1063467113@hotmail.com>
2026-11-18 14:28:36 +08:00
一片一片
fdb9deab6d
fix(runtime): report a failed scheduled-goal cleanup on the run stream (#8322)
* fix(runtime): report a failed scheduled-goal cleanup on the run stream

The finalizer flips a finished run to `error` when it cannot remove the
occurrence's scheduled goal, but it published no `error` event. The stream
then ended as a success while the record and `/wait` reported the failure:
the web UI raises its run-failure toast and streaming IM channels mark a
turn failed only on that event.

Set the same deferred `terminal_error_frame` the unpersisted delivery
receipt uses, so both finalizer-side terminal errors end the stream the
way the record does.

* fix(runtime): publish a staged error frame only for an error outcome

An interrupt accepted while scheduled-goal cleanup runs keeps the run slot
active. If cleanup then raises, the error is staged, but the cancellation
branch persists `interrupted`; the stale frame made a cancelled run show a
failure toast while the record and `/wait` reported interruption.

Publish `terminal_error_frame` only when the committed outcome is the
error it describes, which also covers a cancellation that wins after the
delivery receipt staged its frame.

The delta cases now set the worker's checkpoint mode, and a new test
cancels the run from inside a failing cleanup.

* fix(runtime): publish a staged error frame only for the committed error

A rollback also commits `RunStatus.error`, so the status check alone still
sent the staged cleanup message while the row and `/wait` said `Rolled
back by user`. Require the frame's message to equal the committed error.

The cancellation test now covers interrupt and rollback over both run
stores and both checkpoint modes; the rollback cases fail without the
message check.
2026-11-18 14:25:53 +08:00
ChengLong GU
524f60494f
fix(scheduler): scrub credentials in IM notice text (#8250)
* fix(scheduler): scrub credentials in IM notice text

URL user info and Authorization/Cookie header values carried no secret-like key, so the egress scrubber forwarded them verbatim to third-party IM platforms. Redact the credential itself, keeping the scheme and surrounding sentence readable.

* docs(changelog): record the IM notice credential scrub

* fix(scheduler): redact quoted and multi-pair header credentials

A canonical Cookie header carries one name=value pair per segment, so stopping at the first semicolon left the session cookie in the notice; a quoted Authorization value hid the scheme behind the quote, so only the word Bearer was replaced. The Cookie value is now redacted through the end of the line, and the Authorization pattern accepts an optional quote pair around the scheme and value.

* fix(scheduler): redact signature fields and comma-joined tokens

A SigV4 Authorization value carries its HMAC as a Signature= field after the scheme token, and a comma-joined bearer list stopped at the comma, so both reached the notice. Signature joins the keyword list, and the header value now runs through commas.

* fix(scheduler): redact digest credentials and scrub blocks first

* docs(scheduler): describe end-of-line credential redaction
2026-11-18 14:17:52 +08:00
30bef100w
32dafbe2fe
feat(acp): add Pi coding agent configuration (#8293)
* feat(acp): add Pi coding agent configuration

* fix(acp): address Pi configuration review feedback

* docs(acp): document Pi prerequisites and isolation

* docs(acp): use Pi interactive login in setup examples

---------

Co-authored-by: 30bef100w <30bef100w@users.noreply.github.com>
Co-authored-by: 30bef100w <314075793+30bef100w@users.noreply.github.com>
2026-11-18 11:49:44 +08:00
hataa
c18df580f6
feat(extensions): recover opt-in workflows unattended after restart (#8289)
* feat(extensions): recover opt-in workflows unattended after restart

Workflow launches from an authenticated browser session may opt in to
unattended recovery. The launch captures the session's existing authority
ceiling into a bounded, revocable grant on the workflow record; after a
Gateway restart the single-Gateway SQLite store resumes recoverable
records holding a usable grant through the existing journal-replay path,
without a sign-in.

Host: restore_delegated_authority (sibling of restore_batch_authority)
plus capture_authority on bound handles; the per-operation chokepoint
runs an extension-supplied grant validator so expiry and revocation fail
closed on every operation, including artifact reads. Clustered stores
and uncertain admissions stay on the manual path.

* fix(extensions): address review findings on unattended workflow recovery

- grant_validator validates the current persisted grant during locked
  admission, where the entry is not published yet, and switches to the
  live entry after publication; the previous entries-only lookup 403'd
  every unattended restore of a perfectly usable grant
- delegated restore waits for the AgentRuns host installation signal
  instead of racing the rest of Gateway startup and failing the scan
- cancellation defers grant revocation to the supervisor's post-cleanup
  save, keeping the delegated handle authorized to cancel children the
  recovered workflow already admitted
- the per-operation delegated guard rechecks the current account
  disablement, which token_version does not reflect
- restore stub revalidates per operation like the real host, with
  regression tests for all of the above; format the new fixture and
  condense the extension guidance within its budget

* fix(tests): cancel the recovered workflow on its own service

The fixture's action handlers are bound to the original service, which
stop() already made unavailable; the recovered record lives on the
replacement instance, so the cancel must go through replacement.cancel.

* fix(extensions): let a cancelled replayed child keep its cancelled outcome

The replay fence forced every errored re-dispatched step to
needs_reconciliation, including the deterministic case where the error
is the workflow stopping after its child was already cancelled and
observed. Fence only genuinely uncertain outcomes; a clean cancel of a
recovered workflow now ends cancelled like a fresh one.
2026-11-18 10:46:20 +08:00
哈基米
b6515b1415
fix(skills): reject unextractable archive member trees (#8302)
* fix(skills): reject unextractable archive member trees

An archive with a file that is also an ancestor directory, or a member
that normalizes to the extraction root, crashed extraction with OSError
and the scan preflight raised IndexError on an empty member name, so the
install route returned 500 instead of a validation 400. Validate the
whole member tree before writing anything, comparing NFC+casefolded keys
so case-insensitive and normalization-sensitive filesystems cannot create
the same collision, and enforce the export path/depth/segment limits so
overlong paths fail as validation errors instead of OS errors.

* fix(skills): align archive depth limit with export

export.py limits paths to 32 components relative to the skill root; an
archive member adds the enclosing skill directory, so a valid 32-component
export was rejected on reinstall. Allow 33 archive components and cover the
boundary with a round-trip extraction test.

* fix(skills): reject folded duplicates and enforce the host path limit

Two case-variant file entries collapse into one file on a case-insensitive
filesystem, and a long member path can still exceed the destination
filesystem limit once the staging root is prefixed, raising ENAMETOOLONG
after a partial write. Reject duplicate folded file keys and validate the
full destination path before extraction.

* fix(skills): measure host paths in platform units and guard publication

Win32 limits are counted in UTF-16 code units and long paths are opt-in,
while the previous check compared UTF-8 bytes against 260. Measure with the
platform units and read LongPathsEnabled. Also reject a publication staging
path that exceeds the host limit and translate ENAMETOOLONG during staging
into the installer validation error.

* fix(skills): reject nested members whose staged path is too long

The staging temp-dir name lengthens every member path, so a nested member can
exceed the filesystem path limit while the skill root and the final path fit.
shutil.copytree wraps a child's ENAMETOOLONG in shutil.Error, which carries no
errno or winerror, so the existing translation let it escape as a 500. Check
each member's full staging path before copying.
2026-11-18 09:57:14 +08:00
Hyeonsang Cho
2cc30714c9
fix(auth): answer 400 when a new email is registered during change-password (#8319)
change-password checks that the new email is free, hashes the new
password, then writes. A /register of the same address that commits in
between makes update_user's commit hit the users.email unique index,
and the IntegrityError reached the client as an unhandled 500.

update_user now reports an email index violation as ValueError, like
create_user does for the same race, and the route maps it to the
existing 400 email_already_exists. Other integrity errors propagate.
2026-11-17 22:02:31 +08:00
Bas Cancrinus
f32570d539
feat(opensandbox): configurable sandbox resource limits and requests (#8305)
* feat(opensandbox): configurable sandbox resource limits and requests

The OpenSandbox provider passes no resources to SandboxSync.create(), so
every sandbox gets the SDK default of 1 CPU / 2Gi and the server's default
requests. Workloads that need more (builds, PDF rendering, data work) can't
get it, and clusters with tight quotas can't ask for less.

Add two optional sandbox options, `resource` (limits) and
`resource_requests`, each a map of resource names to quantities, forwarded
to SandboxSync.create(). Numbers become strings; other value types fail at
provider startup. Unset, null or empty keeps today's defaults.

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

* fix(opensandbox): reject blank or non-positive resource quantities; document requests

Review follow-up for #8305:
- Reject blank or whitespace resource names and quantities, and numeric
  quantities that are zero, negative or non-finite, at provider startup
  instead of failing at acquire().
- Document that only Kubernetes runtimes apply resource_requests, that an
  omitted request defaults to its limit, and that requests must fit within
  the limits, including the SDK default 1 CPU / 2Gi when resource is unset.
- Bump config_version to 67 (example, chart values, chart README) and add a
  CHANGELOG entry.

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

* chore: drop the CHANGELOG entries (generated in batch by maintainers)

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 22:01:07 +08:00
Bas Cancrinus
3751eb8daf
feat(extensions): pass a task's final status, error, goal verdict and run metadata to on_task_stop (#8304)
* feat(extensions): pass a task's final status, error, goal verdict and run metadata to on_task_stop

A lead run's final status is decided after the graph has ended: a model
that fails after retries ends the graph normally, so callback-based
tracing reports the run as OK. on_task_stop runs after the status is
persisted but only received completed | failed | aborted.

Additive, so existing contributors keep working:
- TaskInfo.metadata: a read-only copy of the run's metadata (scheduled
  runs carry scheduled_task_id, scheduled_task_run_id, scheduled_trigger);
  empty for subagents.
- TaskInfo.stop: a new TaskStopDetail (status, error, goal_verdict), set
  only on the info passed to on_task_stop.
- deerflow-extension-api 0.2.13.

Refs #8303

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

* test(subagents): compare stop identity without the stop detail; assert its status

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

* fix(extensions): keep TaskInfo identity and serialization; flag unconfirmed stop status

Review follow-up for #8304:
- Exclude TaskInfo.stop and .metadata from equality and hashing
  (compare=False), so the stop info finds state keyed by the start info.
- Replace MappingProxyType with ReadOnlyDict, a dict subclass that rejects
  mutation and freezes nested mappings (lists become tuples). asdict(),
  deepcopy, pickle and json.dumps work again; observers sharing one
  snapshot can no longer change nested values for the next observer.
- TaskStopDetail.persisted: False when the run store did not confirm the
  terminal write or the worker lost ownership, so a staged status is not
  reported as final.
- Document waiting_for_input as a resumable pause (outcome failed) and the
  persisted flag (en/zh observers and reference).

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Nan Gao <thunderggnn@gmail.com>
2026-11-17 19:57:40 +08:00
yi-coding
c2b29f118d
fix(skills): preserve existing images on Gemini decode errors (#8256)
* fix(skills): preserve images on Gemini decode failures

* docs(skills): document legacy MiniMax output handling

---------

Co-authored-by: xiaoyi <xyi74976-del@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-17 16:43:05 +08:00
Wenchao An
c87e238ddd
feat(artifacts): quote and rewrite selected passages (#8212)
* feat(artifacts): quote and rewrite selected passages

* fix(artifacts): verify rewrite spans and clear discarded edits

* fix(artifacts): require explicit rewrite submission in side chat

* fix(artifacts): honor cleared rewrite references on all origins

* docs(artifacts): remove committed selection screenshots

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-17 16:41:29 +08:00
dependabot[bot]
16c8e01a99
chore(deps): bump dnspython from 2.9.0 to 2.9.2 in /backend (#8316)
* chore(deps): bump dnspython from 2.9.0 to 2.9.2 in /backend

Bumps [dnspython](https://github.com/rthalley/dnspython) from 2.9.0 to 2.9.2.
- [Release notes](https://github.com/rthalley/dnspython/releases)
- [Changelog](https://github.com/rthalley/dnspython/blob/main/doc/whatsnew.rst)
- [Commits](https://github.com/rthalley/dnspython/compare/v2.9.0...v2.9.2)

---
updated-dependencies:
- dependency-name: dnspython
  dependency-version: 2.9.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* test(gateway): wait for browser session before checking egress

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-17 16:01:05 +08:00
laoyyu
1cd1a8ac63
fix(storage): reject trailing newlines in blob kinds (#8287)
* fix(storage): anchor the blob-kind pattern at end of string, not before a newline

In Python, "$" also matches just before a trailing newline, so the blob
kind pattern accepted "tool\n" and 64 chars + "\n" (65 bytes) even
though the contract grammar is 1-64 chars and the kind is used as a
filesystem path segment by the local_fs backend. Anchor with "\Z"
instead.

* fix(storage): report the enforced blob-kind pattern

---------

Co-authored-by: laoyyu <laoyyu@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-17 15:59:09 +08:00
哈基米
f95d4f6353
fix(gateway): map checkpoint-mode errors in run-prepare routes (#8296)
* fix(gateway): map checkpoint-mode errors in run-prepare routes

The regenerate and edit-regenerate prepare routes read the same thread
checkpoints as the threads router but built the accessor and read the
latest checkpoint under a generic handler, so a delta/full mismatch
surfaced as a 500 instead of the 409 that names the mode flip. Move the
mapper to a shared module, reuse it for the accessor, latest-checkpoint
and history-scan failures, and update the troubleshooting page now that
the routes behave like the other state surfaces.

* fix(gateway): preserve route-level HTTP errors in run-prepare

The checkpoint-read fallback now sits around the accessor build, so a
config-loading HTTPException from the accessor was being rewritten as a
generic 500. Re-raise HTTPException before the generic handler and cover
the 503 passthrough with a test.

* docs: confirm the mode mismatch before advising a restart

A null token usage or a /runs/wait error body can also come from a
configuration or token-counting failure, so the troubleshooting entry
should point at the 409 from the thread/state endpoints first.

* fix(gateway): remove duplicate checkpoint imports after merge

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-17 12:10:08 +08:00
dependabot[bot]
209255a874
chore(deps): bump soupsieve from 2.9 to 4.0 in /backend (#8317)
Bumps [soupsieve](https://github.com/facelessuser/soupsieve) from 2.9 to 4.0.
- [Release notes](https://github.com/facelessuser/soupsieve/releases)
- [Commits](https://github.com/facelessuser/soupsieve/compare/2.9...4.0)

---
updated-dependencies:
- dependency-name: soupsieve
  dependency-version: '4.0'
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-17 10:44:30 +08:00
ordinary being
39788402ec
fix(scheduler): fence late launch bookkeeping by claim generation (#8268)
* fix(scheduler): fence late launch bookkeeping by claim generation

An expired launch claim can be requeued and immediately reclaimed by the same scheduler process. Because requeue_claimed_run and fail_launching_run only matched status == launching and the lease owner, the original attempt's late busy-thread requeue or launch failure could still clear the fresh claim's lease and release its global execution-budget slot. Another queued occurrence could then claim that slot while the fresh launch was still in flight.

attempt_count already increments on every claim. Capture it from claim_queued_run and pass it to both slot-releasing writes, which now match on the generation as well. The lease-owner check remains; a stale attempt becomes a no-op, while the current generation can still release its own claim. The fence is optional so legacy/custom repositories that do not expose attempt_count keep the previous behavior.

Tests: a SQLite/Postgres repository test recovers an expired claim, reclaims it with the same owner, then replays the stale requeue and failure and asserts the fresh row plus its global slot survive. Service tests pin that the claim attempt is passed on both the busy-thread and pre-launch-failure paths.

* fix(scheduler): log lost requeue claims after a newer generation wins

The busy-thread requeue path discarded requeue_claimed_run()'s boolean, so a generation-guard rejection was indistinguishable from a normal requeue in logs while the attempt no longer owned the occurrence. Capture the result and emit the same lost-launch-claim warning used by the failure path; add a regression test that simulates a newer claim winning.

* docs(scheduler): keep persistence guidance within its soft limit

Compress the generation-fence note so the shared persistence AGENTS.md chain stays below the soft size limit.

* fix(scheduler): omit generation kwarg for legacy claim repos

Both late-bookkeeping calls passed expected_attempt_count=None even when the claim had no generation. Custom repositories that still implement the pre-fence signatures reject that keyword with TypeError. Build the kwargs conditionally so the argument is only sent when the claim actually carries a generation; add a legacy repo regression for both the busy-requeue and pre-launch-failure paths.

---------

Co-authored-by: Tong-bit-art <Tong-bit-art@users.noreply.github.com>
2026-11-17 10:36:27 +08:00
MasterZRC
d59738649f
fix(frontend): isolate background task cancellation reads (#7903)
* fix(frontend): fence background task cancellation cache

Cancel the exact list and target-detail reads before publishing confirmed cancellation state. Forward AbortSignals and refresh only the list, preserving sibling detail loads.

Cover delayed reads after panel close, initial detail loads, cancellation failures, and request isolation with real QueryClient/HTTP regressions.

Fixes #7177

AI-assisted with OpenAI Codex.

* test(frontend): cover cancellation before initial task list loads

Address PR #7903 review by covering the uncached-list case through cancellation, stale-response settlement, and the next enabled refresh. Document the single-argument fetch contract and capitalize the polling guidance.

* chore: remove background task screenshots from PR
2026-11-17 10:10:29 +08:00
Hyeonsang Cho
1e55472147
fix(threads): reject a state update as_node LangGraph cannot compile (#8279)
* fix(threads): reject a state update as_node LangGraph cannot compile

POST /threads/{id}/state passes the client's as_node to the state
mutation graph as its only node. LangGraph refuses __start__, __end__,
its other reserved names and names containing ':' or '|', and that
compile runs before the route's error handling, so those values ended in
an unhandled 500.

Check the name in the request model with the same rules, so it is a 422
on the as_node field before any graph is built or state is written. A
parity test keeps the check aligned with LangGraph's own compile.

* docs(runtime): note the LangGraph floor the reserved-name check was verified on

* docs(checkpoints): re-anchor checkpoint_state rows and list validate_state_mutation_node

The new function shifts the cstate line ranges the reference page cites
for CheckpointStateAccessor.bind and build_state_mutation_graph.
2026-11-17 10:05:01 +08:00
NanPan
13edf25b89
fix(streaming): fence memory writes after retirement or END (#7766)
* Rebase stream lifecycle fix onto upstream main

* Preserve gateway config snapshot and recovered stream retention guard
2026-11-17 09:59:18 +08:00
Hyeonsang Cho
4cd47819a6
fix(gateway): read the live config off the loop in the remaining routers (#8298)
Console pricing, the agent model check, the browser tool switch and
session config, the projects instructions cap, the channel connection
configs, scheduled task writes, the memory config routes and artifact
updates read get_app_config() inline on the event loop. Each now goes
through asyncio.to_thread (safe_app_config_async for artifacts).

Several of these helpers catch Exception, which also hides the gate's
BlockingError, so the anchors record where each read ran.
2026-11-17 09:52:37 +08:00
Heo Hao
557161c474
fix(ci): give a Helm chart change an area label (#8285)
* fix(ci): give a Helm chart change an area label

deploy/ holds the Helm chart and nothing else. No AREA_RULES entry matched
that tree, so a PR touching only the chart -- and the backend/tests/test_helm_*.py
that comes with it -- arrived with no area label at all: #8123 reached merge
with just its size and risk labels, and #8161 only carried area:docs because
it happened to touch a README. Nothing routes those PRs to a reviewer who
owns the chart.

The chart is release/deploy tooling in the same sense as scripts/: bump_version.sh
rewrites its versions, verify_versions.sh and the chart workflow gate its
rendering, and area:ci already owns scripts/. Add deploy/ to that rule.

The offline replay in tests/test_label_declarations.py already proves the
labels the workflow would apply; it only covered the backend package trees.
Move its Node harness into a shared helper, reuse it, and add the chart cases
so this gap cannot reopen.

* Update CI area label matching for helm directory

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-11-17 09:51:17 +08:00
Heo Hao
3d5e360139
fix(capabilities): build the business client off the MCP event loop (#8281)
* fix(capabilities): build the business client off the MCP event loop

`BusinessClient._request` constructed `httpx.AsyncClient()` inline whenever no
client was injected, which is every production call: `build_server` mints a
client per tool invocation for the bundled dingtalk, wecom and HubSpot tools.
`httpx.AsyncClient()` runs `ssl.create_default_context(cafile=certifi...)` in
its constructor, so each notification and CRM request loaded the CA bundle on
the event loop it was serving.

Construct it through `asyncio.to_thread`, the rule the community fetch clients
already follow (crawl4ai, browserless, groundroute), and add the per-client
`tests/blocking_io` regression the family carries so the inline construction
cannot come back unnoticed.

* Enhance cancellation safety for HTTP client in business.py

Refactor HTTP client construction for cancellation safety and ensure proper closure.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-11-17 07:46:01 +08:00
NanPan
4167e2b551
fix(scheduler): fail closed on malformed runtime event preferences (#7440)
* Rebase notification preference fix onto upstream main

* fix(runtime): publish a failed artifact delivery on the run stream (#8252)

* fix(runtime): publish the delivery failure on the run stream

* docs(api): note the delivery-failure stream event

* test(runtime): cover the deferred delivery-failure frame

* docs(runtime): log the delivery fix and explain the fallback exemption

* test(e2e): present the recorded output in the replay scenario

The write/read-file fixture predates the delivery check, so the replayed
run has been ending as an error without presenting note.txt. This PR makes
that failure visible on the stream, which broke the replay golden and the
render e2e. Add the present_files step the current scenario produces and
regenerate the golden.

* docs: drop the CHANGELOG entry

CONTRIBUTING.md asks contributors to leave CHANGELOG.md and CHANGELOG_zh.md
to the maintainers at merge time, so the Unreleased ordering and the
English/Chinese pair stay in sync.

---------

Co-authored-by: 一片一片 <3037678834@qq.com>
2026-11-17 07:29:41 +08:00
Ymmcc
dce29565ca
fix(tavily): load TLS trust off the agent event loop (#8273)
* fix(tavily): load TLS trust off the agent event loop

* test(tavily): cover cancellation during client construction

---------

Co-authored-by: Ymmcc <Ymmcc@users.noreply.github.com>
2026-11-17 07:10:20 +08:00
一片一片
ea1833bd7a
fix(runtime): publish a failed artifact delivery on the run stream (#8252)
* fix(runtime): publish the delivery failure on the run stream

* docs(api): note the delivery-failure stream event

* test(runtime): cover the deferred delivery-failure frame

* docs(runtime): log the delivery fix and explain the fallback exemption

* test(e2e): present the recorded output in the replay scenario

The write/read-file fixture predates the delivery check, so the replayed
run has been ending as an error without presenting note.txt. This PR makes
that failure visible on the stream, which broke the replay golden and the
render e2e. Add the present_files step the current scenario produces and
regenerate the golden.

* docs: drop the CHANGELOG entry

CONTRIBUTING.md asks contributors to leave CHANGELOG.md and CHANGELOG_zh.md
to the maintainers at merge time, so the Unreleased ordering and the
English/Chinese pair stay in sync.
2026-11-16 18:39:06 +08:00
Loveca
db02b77837
feat(plugins): add evidence-gated skill self-evolution example (#7984)
* feat(plugins): add evidence-gated skill self-evolution example

Demonstrates the #7884 roadmap deliverable: a proposed change, the regression
case it fixes, the old and new results, and a rollback to a known-good version,
driven only through the public SkillMutationService contract merged in #5645.

The example stages a candidate against a sealed completed-run evidence anchor,
evaluates recorded JSON regression cases against both frozen bundles with a
deterministic static evaluator (never executing package content), and commits
only a "justified" verdict with an AssessmentRef binding the report to the
exact candidate hash and base revision. Unjustified or failed proposals are
discarded; revert stays append-only. Ships an HTTP walkthrough surface, an
offline lifecycle test against a contract-faithful fake host, and a README
section proposing a concrete evidence standard for the automatic-publication
discussion.

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

* fix(skill-evolution): resolve request models and honor APPLIED publication

The walkthrough routes had never been exercised through FastAPI. With
`from __future__ import annotations`, request models defined inside
`build_router` are unresolvable forward references, so FastAPI read `body`
as a query parameter and every POST answered 422. Move the models to module
scope and cover the routes through TestClient.

A committed operation reports `publication == "APPLIED"`; `READY` is a
`views` state. The committed check listed READY, so a successful apply never
flipped `record.committed` and the ALREADY_COMMITTED guard never fired. Fix
the check, mirror the real literals in the lifecycle fake host, and assert
both the flag and the second-apply refusal.

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

* fix(skill-evolution): address review feedback and register the example catalog

- Bind walkthrough routes to the authenticated principal: owner checks on propose/apply/revert, owner-scoped listing, and non-disclosing 404s.
- Map unknown skills, proposals and operations to 404 for both NOT_FOUND and the real host's NOT_FOUND_OR_FORBIDDEN; map broken case files to 400.
- Ignore URL paths and trim sentence punctuation when extracting in-package references.
- Validate config.enabled's type instead of treating any non-False value as on.
- Soften the README claim about report persistence and add CHANGELOG entries.
- Register the example in the frontend extension catalog, fixing frontend-unit-tests.

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

* fix(skill-evolution): narrow case-file error mapping and cover run visibility

- Label ValueError as CASE_INVALID only on POST /proposals, the route that actually loads case files; apply and revert now surface host bugs as 500 instead of pointing at the case directory.
- Cover the request-scoped run-evidence reader the real Gateway installs: hidden anchor returns 403 SOURCE_NOT_VISIBLE before the host is touched, a denied resolver returns 403, and a visible anchor still proceeds.
- Add regressions pinning host ValueError on apply/revert to 500.

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

* docs(changelog): drop contributor changelog entry per policy

Contributor PRs no longer modify CHANGELOG.md or CHANGELOG_zh.md (#8202);
maintainers add the entry at merge time.

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Nan Gao <thunderggnn@gmail.com>
2026-11-16 16:04:42 +08:00
Totoro
4b98e46388
fix(subagents): revalidate durable batch owners before execution (#8272)
* fix(subagents): revalidate durable batch owners before execution

* fix(subagents): log batch owner lookup failures safely

---------

Co-authored-by: Totoro-qaq <279883115+Totoro-qaq@users.noreply.github.com>
2026-11-16 15:59:09 +08:00
Hyeonsang Cho
54dc5024a6
fix(gateway): serialize the readiness database probe (#8277)
* fix(gateway): serialize the readiness database probe

/health/ready is public, and the module promises that connection-opening
probes run behind a per-kind gate. The ORM database probe never did: it
checked a connection out of the repositories' own engine pool on every
request, so concurrent probe traffic could hold the whole pool (15
connections by default) and leave request handlers waiting.

Run it behind _probe_gate("database") like the checkpointer, stream
bridge and provisioner probes. The gate is per kind, so one request's
probes still run concurrently.

* test(gateway): assert separate probe gates by rendezvous, not wall clock

Each probe now waits until the other has entered its gate, so a shared
gate fails through the readiness deadline instead of a timing margin.
2026-11-16 15:35:18 +08:00
Aurora_
c5d072af91
feat(subagents): add optional SQLite checkpoint history (#8265)
* feat(subagents): add optional SQLite checkpoint history

* docs(subagents): clarify checkpoint history limits

* fix(subagents): resolve checkpoint factory at startup

---------

Co-authored-by: Nan Gao <thunderggnn@gmail.com>
2026-11-16 13:29:26 +08:00
ordinary being
5690221272
fix(scheduler): preserve terminal occurrence when a newer run is active (#8269)
* fix(scheduler): preserve terminal occurrence when a newer run is active

reconcile_launched_run revived a terminal occurrence whose launch returned late, assuming no other occurrence could own the active slot. A queue timeout or pause can terminalize the old occurrence while a newer occurrence is admitted and active; reviving the old row then violates uq_scheduled_task_run_active with an IntegrityError and aborts the launch path, leaving the durable run unassociated.

Under the parent and occurrence locks, detect another active occurrence first. If one exists, keep the terminal status, error and finished_at, attach only the durable run_id/started_at, and log a warning. Revive to running only when the slot is still free. Tests: repo regression reproduces the SQLite UNIQUE violation on main and passes here; full scheduler suite 1115 passed / 132 skipped; ruff and guidance clean.

* test(scheduler): pin terminal payload preservation in reconciliation

Seed the terminal occurrence with its real error and finished_at, then assert reconciliation preserves status, error and finished_at while attaching the late durable run. A future edit that clears either field now fails the regression.

* fix(scheduler): avoid backfilling start after a terminal finish

The preserve path attached the late durable run's start to an occurrence that had already finished, producing started_at > finished_at. Leave started_at untouched: the occurrence never started, and the durable run row carries the real start. Parametrize the regression over newer occurrences in running and queued status so both active-index shapes stay covered.

---------

Co-authored-by: Tong-bit-art <Tong-bit-art@users.noreply.github.com>
2026-11-16 10:22:10 +08:00
Hyeonsang Cho
75443ecc23
fix(auth): ignore a UserInfo response without a sub (#8251)
* fix(auth): ignore a UserInfo response without a sub

fetch_userinfo() compared the UserInfo sub with the ID token's only when
it was truthy, so a response with no sub (or an empty one) was accepted
and its email, email_verified and name replaced the signed ID token's.
OIDC Core 5.3.2 requires the two subjects to match before UserInfo is
used. A missing, empty or non-string sub now raises OIDCUserInfoMismatch,
which the callback already treats as a skipped UserInfo request.

* fix(auth): log a non-string UserInfo sub apart from a missing one

The callback continues silently on a rejected UserInfo response, so the
log line is the only way to tell a provider that omits sub from one that
sends a malformed value. A non-string sub now reports its type.

* test(auth): name the UserInfo sub cases for what they cover

The case list and the callback test also cover a present but non-string
sub, so "no sub" undersold them.
2026-11-15 21:28:36 +08:00
yetuge
778f53a456
fix(workspace): treat hidden output paths as working state (#8254)
* fix(workspace): treat hidden output paths as working state

get_changed_output_paths counted every regular file under outputs as a
produced artifact, so a finished run that left a cursor/state JSON or a .work/
scratch tree there was recorded as delivery incomplete. Skip paths with a
hidden segment below outputs; visible files still count. Part of #8239.

* fix(workspace): share the outputs prefix and document the hidden-path rule

The delivery filter partitioned on a hardcoded /outputs/ while the scanner
built the same prefix in recorder.py, so a future prefix change would silently
stop filtering working state. Export one OUTPUTS_VIRTUAL_PREFIX used by both,
and record the hidden-path exclusion in the runtime guidance contract.
2026-11-15 21:01:09 +08:00
laoyyu
a1a6866ebc
fix(sandbox): end the host-path tail at a comma like the other list separators (#8244)
* fix(sandbox): end the host-path tail at a comma like the other list separators

The reverse-masking tail stops at whitespace and at " ; & | < > ( ) :",
but not at ",". A ,-joined list of host paths in command output therefore
lets the first match's tail swallow every later entry, and those paths
reach the model unmasked -- the same failure mode fixed for :-joined
lists ($PATH, $PYTHONPATH) earlier. The forward patterns have the mirror
defect: a ,-joined list of virtual paths resolves only the first entry.

"," also joins paths in real output (pytest/mypy/sed-style lists), and a
"," inside one path only shortens the match, so no path can be corrupted
by terminating the tail there.

* docs(sandbox): extend the tail-terminator rationale to the comma

Review nits: the _PATH_TAIL rationale comment now explains why `,` ends
the tail alongside `:` (a comma-joined argument listing would otherwise
hide later entries inside the first match's tail), and the snapshot
test's prose no longer calls the `:` stop the only tail change -- the
docstring and the literal's comment both name the `,` delta.

---------

Co-authored-by: laoyyu <laoyyu@users.noreply.github.com>
2026-11-15 20:58:03 +08:00
hataa
ec44f2ff3d
feat(frontend): pin the sent message to the top of the viewport (#8261)
* feat(frontend): pin the sent message to the top of the viewport

After a send, keep the user's turn at the top of the viewport and let the
streamed reply grow downward below the reading position, instead of the
viewport chasing the bottom (ChatGPT-style send behavior).

MessageList detects a freshly appended trailing human group while a run is
active and hands its key to VirtualMessageList. The list then grows a
flexible end spacer sized to the remaining viewport, so the last row can
actually reach the top (the browser clamps the scroll without it), escapes
the stick-to-bottom lock around the alignment, and re-escapes on a timeout
chain until the resize animation from the optimistic message settles; the
spacer shrinks as the reply grows and collapses when the run finishes.
Scrolling down or the scroll-to-bottom button re-locks the follow. History
pagination, thread switches and regenerates are excluded by construction
and covered by DOM tests; Playwright covers the static and the virtualized
list against a held run stream.

* style(frontend): fix scroll-on-send test lint

* fix(frontend): send-pin review follow-ups

Review follow-ups on top of the send pin:

- Hand scroll control back on the first genuine user input: the pin chain
  arms wheel/touchstart/pointerdown listeners on the scroller, and outline
  navigation plus the scroll-to-bottom button cancel it through
  cancelPinFollow — previously every tick reverted user scrolling for ~2s
  after a send.
- Capture the mount-time tail key during the first render so the mount
  absorption is idempotent under StrictMode's double effect run.
- Export LOCAL_HUMAN_MESSAGE_ID_PREFIX from core/threads/hooks and use it
  at both the mint site and the pin predicate.

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-15 20:49:43 +08:00
Arif Rahman
9134cf26c6
fix(gateway): reject artifact archives where a file collides with an implicit directory (#7977) (#8232)
* fix(gateway): reject artifact archives where a file collides with an implicit directory

When a run outputs both a file and a deeper file path whose parent directory
matches the first file's normalized name (e.g. 'Report' and
'report/slides/lesson.pptx', or Unicode NFC/NFD variations), the ZIP archive
builder allowed both entries because it only checked for exact full path
equality. On case-insensitive filesystems, extracting such archives fails because
the file entry blocks directory creation or vice versa.

This change collects all implicit directory prefixes from normalized casefolded
entries and rejects the archive with HTTP 409 (ArtifactArchiveError) if any file
entry name collides with an implicit directory, regardless of receipt order.

Fixes #7977

* fix(gateway): address review feedback on test portability and loop readability
2026-11-15 20:28:29 +08:00
mika
e4b2f4cb9a
fix(scheduler): preserve FIFO behind active same-thread runs (#8231)
* fix(scheduler): preserve FIFO behind active same-thread runs

* test(scheduler): cover launching FIFO blockers

---------

Co-authored-by: mikamikasuki <211269698+mikamikasuki@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-15 20:23:42 +08:00
hataa
453ca834cf
chore(ci): refresh the shard duration baseline (#8264)
Regenerated on ubuntu-latest with the same runner image, Python, uv,
--extra postgres install and Postgres/Redis services as
backend-unit-tests.yml, via 'make test-shard-durations' against
main @ 085b52b5f.

- 41998 entries (was 31912): 31345 carried, 10653 added, 567 dropped
- selection matches the core shards: not live and not bundled_extension
- format unchanged (4-space JSON, sorted keys); content-only diff
2026-11-15 20:17:20 +08:00
Hyeonsang Cho
085b52b5f3
fix(gateway): match conversation reference URLs on the addressed host (#8216)
* fix(gateway): match conversation reference URLs on the addressed host

A conversation URL reference was accepted only when its (scheme,
netloc) equalled Gateway's request.url. Behind TLS that URL is often
http: Docker Compose and Helm run uvicorn without FORWARDED_ALLOW_IPS,
so nginx's X-Forwarded-Proto from another container is ignored, and
nginx.local.conf resends its own $scheme. The browser's https chat link
then got a 422, and so did an explicit :443 or a differently cased host.

Resolve the run request's origin with _request_origin(), as the CSRF
check does (Forwarded / X-Forwarded-Host / Host), normalize the
reference's origin the same way, and compare host and port only. The
scheme cannot tell two deployments on the same host apart, and URLs
remain owner-bound local selectors that are never fetched.

* test(gateway): cover forwarded port, IPv6 and fragment for conversation URLs

Name X-Forwarded-Port in the API.md reference contract: it is appended
when the forwarded host has no port, so a stray value causes a 422.

* test(runtime): synchronize PostgreSQL lease expiration with row lock

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-14 22:17:14 +08:00
Totoro
b0bca9dcb4
feat(mcp): bind HTTP tool credentials to approved custom agents (#8242)
* feat(mcp): bind agent credentials to approved definitions

* fix(mcp): enforce live auth policy and pin task destinations

---------

Co-authored-by: Totoro-qaq <279883115+Totoro-qaq@users.noreply.github.com>
2026-11-14 22:10:33 +08:00
yi-coding
f582b9a87b
fix(skills): read legacy XLS workbooks with an XLS-capable engine (#8215)
* fix(skills): read legacy XLS workbooks with an XLS-capable engine

* fix(skills): keep legacy XLS analysis independent of spatial

* fix(skills): skip unreadable legacy workbooks

* fix(skills): preserve mixed cell types in legacy XLS

---------

Co-authored-by: xiaoyi <xyi74976-del@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-14 22:04:58 +08:00
一片一片
3e2489429f
fix(gateway): reject an unusable promoted record at the input boundary (#8170)
* fix(gateway): reject an unusable promoted record at the input boundary

* fix(gateway): refuse an Overwrite-marker promotion record

* test(gateway): pin the server-owned metadata strip on promoted

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-14 20:22:43 +08:00
Hyeonsang Cho
1804b7c522
fix(gateway): read the run and authorization config off the event loop (#8137)
* fix(gateway): read the run and authorization config off the event loop

get_app_config() stats and hashes config.yaml and extensions_config.json
on every call and reparses them after an edit. Run admission read it
inline on the loop two to four times per start (get_run_context,
build_run_config, the model allowlist, the approval switch, conversation
references), and the model list, model details, skill list, suggestions
and sandbox gates read the authorization section inline once each.

start_run now builds its run context in a worker and reuses that
context's app_config for the rest of the start, so one run start sees
one snapshot. Scheduled dispatch resolves its recursion limit in a
worker, run inputs take only the AgentRuns capability, and the
route-scoped authorization helpers run through asyncio.to_thread, as
/api/models/resolve already did.

* docs(changelog): reference #8137 for the off-loop run and authorization config reads

* fix(gateway): validate the tool approval mode against the run's config snapshot

The approval-mode check added on main read get_app_config() inline in
start_run, so every run start revalidated config.yaml on the event loop
again. It now uses the snapshot the run context was built with, like the
model allowlist and the approval switch.

* test(gateway): seed the skill catalog the authorization anchor lists

The skill listing anchor relied on the checkout's skills/public tree
containing academic-paper-review. It now writes one allowed and one
hidden skill under its own skills.path, so it passes without the repo
catalog and still fails if the policy is not applied.
2026-11-14 17:33:41 +08:00
杰尼龟
a68dc2a1a0
fix(setup): honor pinned pnpm version in host runner (#8183)
* fix(setup): honor pinned pnpm version in host runner

* fix(setup): harden pnpm version probing

* docs: drop changelog edit from pnpm PR
2026-11-14 17:09:46 +08:00
Luck
f086cce86e
fix(channels): deliver each presented file once, in presentation order (#8209)
* fix(channels): deliver each presented file once, in presentation order

_extract_artifacts scanned the turn newest-first and kept every
present_files path, so a file presented twice in one turn was uploaded
twice and files from separate calls arrived newest call first. Keep the
first-presented order without repeats, as the merge_artifacts reducer
does for the web UI.

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

* test(channels): pin dedup of a path repeated inside one present_files call

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 17:08:28 +08:00
ChengLong GU
35d33bea75
fix(frontend): treat invalid cron fields as non-scheduled (#8020)
* fix(frontend): keep invalid cron schedules as custom

* test(frontend): cover inclusive cron bounds

* docs(scheduled-tasks): note cron preset bounds

The form keeps an out-of-range cron as custom; the guide now says which
numeric ranges a preset covers and that saving such an expression returns
422. CHANGELOG entries cover the fix.

* docs(scheduler): clarify invalid cron save validation

---------

Co-authored-by: Nan Gao <thunderggnn@gmail.com>
2026-11-14 16:36:25 +08:00
Wenchao An
4f3a8b790d
feat(sharing): add revocable read-only conversation snapshots (#8211)
* feat(sharing): add revocable read-only conversation snapshots

* fix(sharing): preserve fork idempotency and allow snapshot cleanup
2026-11-14 12:22:22 +08:00
Rei
9cb2bde557
test(ci): run bundled extension behavior suites outside the core shards (#8180)
Bundled examples keep their behavior tests in backend/tests/, so the core
backend workflow ran optional extension behavior on every pull request. Mark
those suites with pytest.mark.bundled_extension, exclude them from the core
shards and from the duration baseline, and run them in a dedicated workflow
through make test-bundled-extensions. Tests of host mechanisms stay in the
core shards even when an example package is the payload.

The marked suites import deerflow.agents, config, runtime, knowledge and
app.gateway, so the workflow triggers for backend/packages/**,
backend/app/gateway/** and the marked test modules; a backend test pins those
paths, the make target and both marker selections, and fails when a marked
module is missing from the path list. Host/extension compatibility checks — a
host API gate and authorization of contributed routes — live in
test_extension_host_contracts.py so they still fail core CI. The committed
duration baseline drops the 482 entries for the excluded suites.

Refs #8173

Co-authored-by: REI-330 <173389910+REI-330@users.noreply.github.com>
Co-authored-by: willem-bd <143703838+willem-bd@users.noreply.github.com>
Co-authored-by: Eilen6316 <136898293+Eilen6316@users.noreply.github.com>
2026-11-14 09:12:25 +08:00
kongxin
cee54cdd49
fix(web-fetch): stop sending .env.example placeholder keys to providers (#8206)
* fix(web-fetch): stop sending .env.example placeholder keys to providers

make config and make setup copy .env.example into .env, and the template
set nine search/fetch provider keys to example values such as
JINA_API_KEY=your-jina-api-key. The default keyless Jina Reader sent
that text as a Bearer key, so every web_fetch on a fresh install failed
with 401 while make doctor reported web fetch as configured.

- .env.example comments those nine lines out, like every other credential
  in the template already is.
- provider_credentials.resolve_api_key reads a your-...-key/-token/-secret
  value as unset, so existing .env files that still hold the placeholders
  recover without editing, for every provider that resolves keys there.

* chore: leave the changelog entry to merge time

Per CONTRIBUTING.md (#8202), maintainers add changelog entries when they
merge a pull request.

* fix(web-search): route every provider key and doctor through one placeholder rule

Review follow-up for #8206:

- provider_credentials exposes is_template_placeholder(), the single
  definition of an .env.example example value. key/token/secret must be
  a whole hyphen-separated word, so a real value such as your-monkey or
  your-passkey is no longer dropped.
- Serper, Serply, Sofya, SpecStream, Unbrowse, Webz, Brave, Tencent WSA
  and You.com resolve config and environment keys through
  resolve_api_key instead of private strip-and-send copies, so an old
  .env that still holds the template value no longer sends it.
- make doctor asks the same predicate: a placeholder key is reported as
  still holding the .env.example value instead of "set", and a literal
  placeholder in config.yaml falls back to the environment key as the
  runtime does.
- A census test keeps credential environment reads under community/
  wrapped in resolve_api_key.

* fix(web-search): match shipped placeholders exactly and mirror Browserless precedence in doctor

Second review follow-up for #8206:

- is_template_placeholder() matches exactly the your-... values that
  .env.example ships instead of a pattern, so a token an operator chose
  (a self-hosted Browserless TOKEN such as your-review-team-token) is
  sent again. A test keeps the set equal to the template.
- make doctor mirrors Browserless: a configured token field is
  authoritative, blank or not, and BROWSERLESS_TOKEN is read only when
  the field is omitted. A blank or placeholder token now warns instead
  of reporting the variable, cross-checked against the client.
- The keyless Jina and You.com providers stay ok but name JINA_API_KEY
  or YDC_API_KEY when a placeholder there is ignored, and a literal
  placeholder api_key in config.yaml is named when no env key backs it.

* fix(doctor): match each web provider's key precedence; drop the dead Jina api_key from docs

Found while re-checking #8206 against every provider's runtime:

- Browserless used as web_fetch had no doctor key check; it now gets the
  same authoritative token handling as web_capture.
- InfoQuest reads only INFOQUEST_API_KEY, so doctor no longer counts an
  api_key field in its tool config as configured.
- GroundRoute needs a key for every call but had no doctor entry, so a
  missing key reported ok.
- You.com names a placeholder api_key in config that it ignores.
- The Jina web_fetch docs snippet carried api_key: $JINA_API_KEY, which
  the tool never reads. With JINA_API_KEY now commented out in
  .env.example, that line made config loading fail on a fresh install.
- The provider_credentials docstring now scopes doctor's use of the
  predicate to web provider keys, and the scripts guide no longer says
  .env.example ships live placeholder keys.
2026-11-13 23:23:29 +08:00
Luck
077773a967
fix(sandbox): match local grep lines without their terminator (#8210)
* fix(sandbox): match local grep lines without their terminator

find_grep_matches ran the regex on each line with its trailing "\n", so
patterns that can consume the newline (\s$, [^a-z]$, \n) matched every
newline-ended line while the returned line was shown stripped. Strip the
LF or CRLF terminator before matching, as grep(1) and the remote sandbox
providers do.

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

* docs(sandbox): clarify local grep CRLF handling

* test(sandbox): cover literal grep line terminators

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-13 23:17:18 +08:00
Wenchao An
dba950443d
feat(search): find conversations and jump to matching messages (#8032)
* feat(search): find conversations and jump to matching messages

* test(extensions): align example registry with search contribution

* test(search): scope bookmark search to its extension

* fix(search): address review correctness and scaling gaps
2026-11-13 23:01:38 +08:00