Repository navigation
Commit 71e04e2
authored
* fix: direct-surface describe ids (#1083), config-apply errors (#1084); restate SC-001
Closes #1083. Closes #1084.
#1083 — describe_tool on the DIRECT surface returned identifiers that surface
cannot be asked for: the canonical "<server>:<tool>" (it registers
"<server>__<tool>") and a `call_with` naming call_tool_read/write/destructive
(intent variants the direct surface does not expose). Following either verbatim
gave "tool not found". Deferred mode makes this the live discovery path, since
it tells agents to recover schemas through describe_tool.
applyDirectSurfaceIdentity sits at the same assembly seam as output_schema —
putting it in the shared builder would change indexed-surface bytes. It swaps
the registered display name in and drops `call_with`. Dropped rather than
retargeted: it answers "which variant do I dispatch through", a question this
surface does not have. No signal is lost — DeriveCallWith is a pure function
of `annotations`, which travels on the same definition, so a consumer can
recompute the tier. The D10 safety test is re-pointed at that source rather
than deleted. Both id spellings still WORK as input; only the echo changes.
Verified live: the identifier describe_tool returns now executes.
#1084 — three defects:
1. A value the validator rejects returned 500. ApplyConfig discarded its
structured errors, so handlers could not tell "you sent a bad value" from
"we failed to persist a good one" without string-matching. The errors now
ride on the result and writeApplyConfigError classifies: 400 with the
offending field in a structured payload, 500 reserved for real faults.
2. internal/httpapi/server.go called SugaredLogger.Error(msg, "key", val),
which CONCATENATES — hence "patcherrorconfiguration...". 97 call sites
converted to the *w variants, including ones passing zap.Field values to
the sugared API (broken a second way). Argument-parity checked per call.
3. /api/v1/status embedded a status snapshot whose upstream_stats and
tools_indexed nothing refreshed — stuck at "Connecting"/0 for the life of
a process whose servers were long Ready, disagreeing with the correct
top-level field.
Cross-model review caught two defects in my first attempt: refreshing
inside Server.GetStatus() made every poll walk all servers TWICE, and the
SSE stream forwards a snapshot that never passes through GetStatus() at
all, so it stayed stale. Now a withLiveUpstreamStats helper at the API
layer, applied at all three emission sites, each reusing the traversal it
already does for its top-level field. It copies rather than mutates — the
SSE map is owned by the publisher.
SC-001 restated per corpus shape (maintainer decision). The original ≥70%/≥85%
was unreachable: measured 29.7% (45-tool corpus) and 34.8% (527-tool snapshot)
against an arithmetic ceiling of 38.9%, because the target assumed schemas
dominate the payload and names/descriptions/annotations actually do. Now ≥25%
and ≥30% — roughly 15% relative headroom below each measured value, as a
regression floor rather than a second projection. Both bounds are asserted, so
that test file IS the SC-001 gate; a new fleet-scale case independently
reproduces T035a's numbers from its own loader. The original 70% is retained as
an upper tripwire: clearing it means the corpus premise changed.
* docs(changelog): record spec 102, the settings UI, and these fixes
The Unreleased section is hand-written, and the flagship feature of the next
release was missing from it entirely: schema-deferred direct mode shipped in
#1063 with no changelog entry, and the settings UI in #1082 likewise.
The feature entry states the two things a reader most needs and would otherwise
get wrong: that it is OPT-IN (default `full`, unchanged behaviour), and that the
measured saving is ~30% — not the ~88% the roadmap projected until today. Any
launch copy drafted from the old number would be wrong.
Also records #1083 and #1084 under Bug Fixes.
1 parent cb97dd1 commit 71e04e2
14 files changed
Lines changed: 790 additions & 206 deletions
File tree
- internal
- httpapi
- runtime
- server
- specs/102-schema-deferred
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
26 | 44 | | |
27 | 45 | | |
28 | 46 | | |
| |||
31 | 49 | | |
32 | 50 | | |
33 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
34 | 70 | | |
35 | 71 | | |
36 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
729 | | - | |
| 729 | + | |
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
0 commit comments