Repository navigation
fix(den-api): accept RFC 3339 offsets for Calendar and expose query constraints in search_capabilities - #4377
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Test evidence — google-workspace-retrieval-enforces-drive-access-and-bounds-model-visible-output — ✅ passed✅ passed · 4 expectations passed · 0 failed · 0 pending verdict passed · 0 user observations · 0 probes · steps 0/0 ℹ️ ASSERTION — 1. General Drive retrieval requires a verified read grantThe focused connector suite proves selected-file access cannot call general Drive search or read, missing grants fail closed, and the same file created directly in My Drive succeeds with read-only or full Drive access. Provider authorization failures remain actionable, file-read 404s remain bounded and ambiguous, folders stop after metadata without traversal, and Shared Drive flags are sent as a separate compatibility correction.
ℹ️ ASSERTION — 2. Gmail metadata retrieval overlaps bounded requests without reordering resultsSix delayed metadata requests overlap with a maximum concurrency of four while the response remains in the original Gmail list order.
ℹ️ ASSERTION — 3. The existing MCP path keeps model-visible connector output boundedA real search_capabilities and execute_capability journey omits oversized non-image base64 before download where metadata permits, preserves existing small attachment bytes, compacts large JSON, and applies model-visible text limits to Drive and Gmail content without reducing their retrieval-layer limits.
ℹ️ ASSERTION — 4. Calendar datetimes accept RFC 3339 offsets and search hints expose real query constraintsCalendar list and create accept RFC 3339 UTC offsets, forward them unchanged, and reject malformed local datetimes without calling Google. MCP search returns plain JSON Schema constraints and descriptions for Gmail and Calendar query parameters without leaking validator internals or adding query schemas to operations without query parameters.
Test run created 2026-09-03T23:01:10.611Z · Source: |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (a7ad0275b9edea7a019bfee30a5593d2ac98547c). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
…onstraints in search_capabilities
Google Calendar timeMin/timeMax/start/end used z.string().datetime(),
which only accepts a trailing Z, so every offset timestamp the agent
naturally produced (2026-09-03T17:00:00+02:00) failed with
"Invalid ISO datetime" even though Google accepts it. Widen to
{ offset: true } and state the format in each description.
search_capabilities returned query hints as a live Zod object
(inputSchema) that JSON.stringify dumped as {"def":{...,"checks":[]}},
dropping constraints like Gmail maxResults <= 25. Replace it with a
querySchema built from the OpenAPI query parameters, which already carry
minimum/maximum/default/format/required/description.
a7ad027 to
61bd83a
Compare
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (61bd83afed6a6571b754266d2f89683003ebec07). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Why
Two recurring agent failures against the Google Workspace native capabilities, pulled from real OpenWork session history:
Invalid ISO datetimeon Calendar — hit in 7+ sessions since Jul 29 (getCapabilitiesGoogleWorkspaceCalendarEventstimeMin/timeMax,postCapabilitiesGoogleWorkspaceCalendarEventsstart/end). The model sends a valid RFC 3339 timestamp with an offset (2026-09-03T17:00:00+02:00); the route usedz.string().datetime(), whose defaultoffset: falseonly accepts a trailingZ. Google Calendar accepts offsets, so we were stricter than upstream, and the description gave no hint.maxResultscap invisible to the model — the route enforces.max(25)and even documents "capped at 25", butsearch_capabilitiesreturned query hints as a live Zod object (inputSchema: operation.inputSchema) thatJSON.stringifydumps as{"def":{"type":"number","checks":[]}}— constraints stripped, so the model asks for 50 and getstoo_big.What
routes/org/google-workspace.ts:z.string().datetime({ offset: true })on the four Calendar fields; descriptions now state "RFC 3339 date-time with a UTC offset or Z" with an example.mcp/catalog.ts: newgetQueryParameterSchema(operation)— plain JSON Schema{ type: "object", properties, required? }built from the OpenAPI query parameters, which already carryminimum/maximum/default/format/required/description.mcp/search.ts,mcp/native-capabilities.ts: emitquerySchemanext tobodySchema; drop the leakedinputSchema.mcp/agent.ts: declarequerySchemain the output schema; tool description lists it.Out of scope (follow-up):
microsoft-365.tshas the same.datetime()ontimeMin/timeMax/start/end, but Graph's event-createdateTimeTimeZone.dateTimeis offset-less, so widening it needs a conversion step rather than a validator change.Proof
Spec:
evals/specs/google-workspace-connector-retrieval.test.ts(extended; wraps the den-api bun suite and pins test names). New den-api tests, each with its negative half:calendar events list accepts RFC 3339 offsets and forwards them verbatim— 200 and fake Google receives+02:00unchanged;2026-09-03 00:00→ 400invalid_request, Google not called.calendar event create accepts RFC 3339 offsets and forwards them verbatim—start.dateTime/end.dateTimeforwarded verbatim;2026-09-03T17:00→ 400, Google not called.search_capabilities exposes query parameter constraints as JSON schema instead of leaked validator internals— real MCPtools/call: GmailquerySchema.properties.maxResults={integer, min 1, max 25, default 10, "capped at 25"}; Calendarrequired: [timeMin, timeMax],format: date-time, description contains+02:00; noinputSchemakey; no"checks":/"def":in the serialized match or text; Gmail drafts (no query params) has noquerySchema.native-capabilities.test.ts— replaced the assertion that locked in the leak by reference identity.Lane: local fallback (no Daytona credentials in this shell); cold boot, no
OPENWORK_EVAL_DEN_API_URL.Pre-existing, reproduced on a clean
origin/dev(431c8ce) control worktree with the same commands:test/mcp-agent-config-policy.test.ts14 pass / 2 fail (same two discovery tests), and runninggoogle-workspace-capabilities+native-capabilitiesin one bun invocation → 2 fake-Google env collisions innative capability execute. Neither is touched by this diff.Verdict: Passed.