Skip to content

fix: name function_logs and event_message in the ClickHouse query_logs hint - #376

Open
Rjabov wants to merge 5 commits into
supabase:mainfrom
Rjabov:patch-1
Open

fix: name function_logs and event_message in the ClickHouse query_logs hint#376
Rjabov wants to merge 5 commits into
supabase:mainfrom
Rjabov:patch-1

Conversation

@Rjabov

@Rjabov Rjabov commented Aug 24, 2026

Copy link
Copy Markdown

Closes #375

Problem

On hosted projects get_logs is hidden, so query_logs is the only logs tool. Its ClickHouse
hint names function_edge_logs but not function_logs, and tells the model to read
log_attributes['<key>'] without mentioning event_message. log_attributes holds only
metadata (level, execution_id, request_id); the log line text lives solely in event_message.

The result is a model that reaches the right table, reads the wrong column, and tells the user
their output was never stored:

"The console.log output from your order-sync edge function is not being stored in the
queryable project logs."

Change

Names both Edge Function sources, and states that event_message carries the log line while
log_attributes carries metadata. Additive prose only; the select distinct source from logs
escape hatch is unchanged, and the BigQuery hint is untouched (self-hosted Logflare does not
serve function_logs, and its not.toContain assertion still passes).

Evidence

32-run matrix against a live project (4 models × 2 prompts × 2 reasoning levels × 2 builds),
test function returning HTTP 200 on every call while logging an error line, graded on whether
the answer contains the actual error text.

  • Naming the source alone: 14 comparable cells, zero changed. Models already reach
    function_logs unaided (Haiku did so in 7/7 runs on both builds).
  • Adding event_message: the 5 previously-failing cells, 2 replicates each, 10/10 pass,
    median 1.5 queries versus a median of 4 while failing.

Local: pnpm run build, 215/215 unit tests, pnpm typecheck clean,
npx @biomejs/biome@1.9.4 ci . clean (89 files).

Two caveats: an earlier version of this description presented a scripted client with hardcoded
SQL as though an agent had chosen the query, which overstated it. And I retested only
previously-failing cells, so I have not shown the new wording leaves passing cells alone.

Published metadata

This edits a .describe() string, in the frozen-fields list. Purely additive, no schema shape
or optionality change, so it should fit the expand step, but flagging in case it should be
folded into the next plugin submission.

Rjabov added 3 commits August 25, 2026 13:27
Updated the schemaHint for ClickHouse logs to include additional details on reading log line text and per-row metadata.
Add expectation for event_message in SQL description test
@Rjabov Rjabov changed the title fix: name function_logs in the ClickHouse query_logs hint fix: name function_logs and event_message in the ClickHouse query_logs hint Aug 25, 2026
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.

query_logs hint omits function_logs, so agents can't find Edge Function console output

1 participant