Clerk could not bulk-set Priority on the Issue Tracker (2026-11-16)
Why a one-line bulk attribute edit failed: the agent never saw the list or the attributes, and the tool that answers it was not enabled.

What happened

On 2026-11-16 15:53 UTC a teammate asked Clerk, in a comment on the Issue Tracker, to "add High value to all the Priority empty fields Issues". 86 seconds later Clerk replied that it could not enumerate which issues have an empty Priority, and changed nothing.

The request was easy. The tracker has 218 issues; 101 have no Priority (63 lack the key, 38 hold an empty string). One attribute query returns exactly those: in:hm://z6MkuBbsB1Hb…/tasks (missing:Priority OR Priority="").

Session c412b8bc-f952-429b-854d-0567f51888d9 on agents-stable (sae-prod), build 2026.11.4 (695e873ea), model gpt-6-luna at high reasoning, 13 turns, 343k tokens.

Why it failed

    The query tool was not enabled on Clerk. query (documents by attribute, with missing:key) and attributes have existed since #1153, but DEFAULT_AGENT_TOOLS is search, websearch, execute, publish. Clerk's tool list is exactly that default, so ~/tools never showed query. This alone would have solved the task.

    The :directory read drops every attribute. The underlying Query call returns each child's full metadata, Priority included; readDirectoryHypermedia keeps only name, summary, update time and children count. So even a complete listing could not answer "which are empty".

    Clerk saw 26 of 218 issues. The deployed build cuts every tool result to 8 KB for the model. The directory result is 100 KB because it carries the list twice (documents array, 65 KB, then markdown, 37 KB) and documents is serialized first. Clerk read the directory twice and got the same first 26 entries both times. The tracker document itself was cut to about a quarter of its list.

    Unknown read inputs are ignored silently. The second directory read passed format: "json" and options.limit: 10. Neither exists for this view; the call returned the identical 100 KB result with no hint.

    search could not help. * returns nothing, and a body search for "Priority" returned 50 hits, none under /tasks, because attributes are not searched. The search contract Clerk read does not mention query.

    The model stopped early. After reading one issue (already High) it gave up, without paging, delegating a script child, or using execute. With points 1 to 5 fixed this would not have mattered.

Current main does not fix it

Main (#1357) raises the ceiling to 32 KB and pages long text, but the directory view defeats the pager: documents still precedes markdown, so the pager shrinks the markdown page to 256 characters trying to fit, and the 32 KB cut then lands inside documents and removes the page info. Simulated on this tracker: 107 of 218 entries visible, no next-page pointer, and options.offset changes nothing useful. Attributes are still absent and query is still off by default.

Suggested fixes, in order


    Add query and attributes to the default tool set, and turn them on for existing agents (Clerk today, by hand, in its Tools settings).

    In the directory view, send the model one compact list (no duplicate documents array) that pages correctly, and show each child's attributes or at least say that query filters by them.

    Reject or warn on unknown options and unsupported format instead of ignoring them.

    Point from the search contract and empty search results to query.

Smaller findings: Clerk's ~/memory/ holds 960 entries (114 KB) and is listed at the start of every run, where the model sees only the first 8 KB. Three issues carry Priority "Small", which the schema does not allow. 53 of the 101 empty-Priority issues are Done, so "set them all to High" may deserve a scope question from the agent before writing.

How this was checked

Transcript decoded from session_events on sae-prod; the listing, counts and the query were run against hyper.media; the model-facing view was reproduced from the stored tool output with the 8 KB (prod) and 24/32 KB (main) limits. Code: apps/src/api-service.ts (readDirectoryHypermedia, paginateReadResult, boundModelToolResultText), apps/protocol/src/tool-registry.ts (queryTool), frontend/packages/ui/src/agents/agent-tools.ts (DEFAULT_AGENT_TOOLS).

Review of the query tool, and what was fixed

A second pass looked at whether an agent can actually run sophisticated queries. It could not, for more reasons than the first pass found. Fixes are committed locally as e76f3cba3 on branch worktree-bulk-priority-failure (not pushed, not deployed).

Found

    No agent made in the app could call query at all. The server gates callables on the agent's tools array, the create dialog always writes that array, and the settings UI silently drops query when it saves. Not a missing default: an unreachable tool.

    A subtree scope is not "the rows of this collection". in:hm://…/tasks matches the tracker document itself and every grandchild. A bulk edit built on it would have set Priority on the tracker and on 25 sub-documents. There was no way to say "direct children".

    Keys and values are case-sensitive with no feedback. priority=High and Priority=high both return nothing, silently. The tool's own example used lowercase status and priority.

    key!=value skips documents that lack the key (74 results where NOT key=value gives 142). Undocumented.

    "Empty" needs two conditions (missing: plus =""); 36 of the tracker's blank priorities are empty strings, 62 are absent.

    No totals. "How many" meant paging through everything; no group-by.

    Malformed queries were answered without comment. Parse diagnostics were computed and discarded; a sort: directive inside q was stripped and ignored.

    Each result was sent to the model twice (markdown plus a results record), so a 100-row page overflowed the result ceiling and lost its page token, which sat at the end.

    Keys with spaces (Depends On) could not be written in q; a quoted number was coerced to an integer; key="" did not round-trip.

    The prompt never mentioned query, attributes, or scripting a bulk edit.

Fixed


    query and attributes are always callable.

    query gained childrenOf, select, count, groupBy, sort: inside q, warnings for parse problems and for !=, and a hint when nothing matches because of case (scoped to the queried space).

    The grammar gained empty:key, quoted keys, and string-preserving quoted values (shared with the CLI and Explore).

    The model reads one compact line per document with the page token first; scripts still get the records.

    :directory lists every child with its attributes, pages to the end, and names the query call that filters it. Ignored read options are reported.

    The system prompt, the query/search/read contracts and the documents write guide now say when to query, and the guide carries a bulk-update script (query all pages, then metadata-only updates eight at a time, report failures).

Checked: 842 agents-service tests pass, including 12 new ones; the guide's script is executed in the script sandbox by a test; the new tool was run read-only against the live tracker (99 empty priorities among 222 direct children, in one call of about 600 ms).

Not done

    No live model run. The prompt and tool changes are verified mechanically, not by watching an agent complete the request.

    Frontend typecheck was not run in the worktree (no root install); the grammar's exported types did not change. Run the usual pre-push checks before pushing.

    Backend gaps remain: the daemon cannot filter to one level, count, or compare case-insensitively, and it indexes only string, integer and boolean values (no lists, no decimals). childrenOf and count work around the first two by paging in the agents service.

    search with * still returns nothing.

    Clerk's ~/memory/ (960 entries) and its 40 authored tools still crowd its listings.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Connections0
Linked document · Outgoing linkLinked documentLinked document · Outgoing linkLinked documentClerk could not bulk-set Priority on the Issue Tracker (2026-11-16)Clerk could not bulk-set …
Citations 0Children & links 2

Loading child documents…

Connections show where other documents or comments link to this document.

Related documents

Loading connections…