Skip to content

fix(runtime): return ai_instructions from the list_metrics_views tool - #9846

Merged
begelundmuller merged 1 commit into
mainfrom
nishant/fix-list-metrics-views-ai-instructions
Sep 1, 2026
Merged

fix(runtime): return ai_instructions from the list_metrics_views tool#9846
begelundmuller merged 1 commit into
mainfrom
nishant/fix-list-metrics-views-ai-instructions

Conversation

@nishantmonu51

Copy link
Copy Markdown
Collaborator
  • The list_metrics_views handler built a res map containing the instance's ai_instructions, but returned a typed result struct without it — the map was discarded, so project ai_instructions never actually reached MCP clients, even though the MCP server instructions tell clients to obey an ai_instructions field in tool responses.
  • Adds the field to ListMetricsViewsResult and populates it for external MCP clients only (non-rill user agents): Rill's own agents already receive the project instructions directly in their prompts, so including it in their pre-invoked tool results would duplicate it in the conversation.
  • Adds a test covering both the external-client and internal-agent paths.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

https://claude.ai/code/session_017udazBgdXmdTXMTq7sTh2L

The handler built a res map containing the instance's ai_instructions,
but returned a typed result struct without it, so the map was discarded
and project ai_instructions never reached MCP clients;
the MCP server instructions tell clients to obey an ai_instructions field in tool responses,
making this a silent no-op since the tool was introduced.

Add the field to ListMetricsViewsResult and populate it for external MCP clients only:
Rill's own agents already receive the project instructions directly in their prompts,
so including it in their pre-invoked tool results would duplicate it in the conversation.

Claude-Session: https://claude.ai/code/session_017udazBgdXmdTXMTq7sTh2L
@nishantmonu51 nishantmonu51 added Type:Bug Something isn't working Size:S Small change: under 100 lines labels Sep 1, 2026

@begelundmuller begelundmuller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@begelundmuller
begelundmuller merged commit a152b40 into main Sep 1, 2026
16 checks passed
@begelundmuller
begelundmuller deleted the nishant/fix-list-metrics-views-ai-instructions branch September 1, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size:S Small change: under 100 lines Type:Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants