Skip to content

The agent's tools get the second clock - #350

Merged
WaylandYang merged 2 commits into
devfrom
feat/the-tools-get-a-second-clock
Sep 5, 2026
Merged

The agent's tools get the second clock#350
WaylandYang merged 2 commits into
devfrom
feat/the-tools-get-a-second-clock

Conversation

@WaylandYang

@WaylandYang WaylandYang commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Closes #347.

entity_facts took at and nothing on the tool surface took as_of. The store and the HTTP API have carried the record axis since #317 and #338; the agent was left at None as a separate decision. On the temporal benchmark's chat probe that decision cost seven of thirteen misses: every record-axis question came back as a narrated plan, because the agent had no tool that could ask it.

What changes

  • entity_facts takes as_of beside at, threaded to entity_detail, which already accepts it. The tool's detail line names both when both are given — 4 facts at 2024-08-01, as recorded by 2026-09-05 — so the trace shows which clock answered.
  • search_chunks takes as_of, threaded to retrieval::hybrid (Retrieval reads the base as it was #338). Its description says in one clause what the retrieval module header says at length: full-text recall stays current, so hits are correct but may be incomplete.
  • One parser for both moments, parse_when: YYYY-MM-DD or RFC3339, anything else None. A record-axis moment is usually a timestamp ("the instant the first batch finished"), which a date cannot hold.
  • The system prompt names the second clock once and tells the model when to use it — "what did we know / have on record / believe as of", "before the memo arrived" — and that it is the only way to answer such a question rather than something to plan around. The model already uses at correctly when a question names a date; this is vocabulary.

MCP serves the same tool definitions, so its clients get both fields without a change there; the in-app MCP page documents them.

Two parameters, never one, for the reason 0019 gives: folded together they answer "the world in March as we understand it now" with "as we understood it then", and both look plausible.

Verified

A unit test on parse_when covering the date form, the timestamp form with surrounding whitespace, and two things that must not parse. cargo fmt --check, cargo clippy --all-targets clean, tool tests 8/8. The benchmark's chat probe, re-run against this build (with #349) on the same base: 28 / 35 overall, up from 24 / 37 before the two fixes (the sheet moved one question into the known-gap column in between; the bench PR carries the details). On the record axis — the questions this change is for — 9 / 14, from 7 / 14. The model now passes as_of and passes it as an instant when the question gives one (the trace shows 2 facts as recorded by 2026-09-05, the answer repeats 2026-09-05T02:43:53.382Z; the trace line itself rounds to the day, noted on #351). Of the five record-axis questions still missed:

  • two are right answers the substring scorer cannot read: "there is no record of Li Si being connected to Project Helios at that time" names the forbidden entity in a negation;
  • two ask the user for the correction's date instead of reading it from changes — and reading it would not have been enough, because changes prints the day and the correction landed the same day as the first ingest (The changes tool rounds the record clock to a day #351);
  • one narrated a plan and never called a tool.

Two more questions moved into the known-gap column while this was being measured (#345, and the undated-fact reading in #352); the chat probe cannot do better than the ledger on those.

🤖 Generated with Claude Code

WaylandYang and others added 2 commits September 5, 2026 11:41
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit 619061e into dev Sep 5, 2026
4 checks passed
@WaylandYang
WaylandYang deleted the feat/the-tools-get-a-second-clock branch September 5, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The agent's tools have one clock: nothing on the tool surface takes as_of

1 participant