Repository navigation
Replies: 1 comment
|
A use case for this idea, from a self-hosted brain with one code source per customer product and one agent per customer, each granted only its own source. We want these agents to help customers describe a change request and judge roughly how big it is before any coding session starts. So what we would use is the narrower first step a contributor proposed in a comment on #5052: Until then they would use search, and exact questions would go to a coding session with a checkout. |
Uh oh!
There was an error while loading. Please reload this page.
Moved from #5052, opened by @nikhil-tahalramani on 2026-09-12. Feature requests now live in Discussions > Ideas.
What problem does this solve?
The six code-read operations —
code_def,code_refs,code_callers,code_callees,code_blast,code_flow— are unreachable by every MCP caller, which is the only kind of client most users have.src/core/ops/code-intel.ts(v0.48.5.0 and identical on master as of 2026-09-12):ctx.remoteisfalseonly for the trusted local CLI, so an agent connected over stdio or streamable-http getspermission_deniedfor all six. The comment above the block explains why:That is a reasonable fail-closed default. The problem is that it has no exit path for the operator who does want it: there is no config key, no env var, and no per-token scope. The only way to reach the code graph from an agent today is to shell out to the CLI — which works fine and returns the same JSON — so the gate stops the sanctioned path while leaving the workaround open.
What does the solution look like?
Any one of these would be enough; the first is the smallest:
code.remote_reads = false | scoped | true, defaulting to today's behaviour.scopedwould honor the caller's existing source grant — the read policy the comment says is missing is already enforced forsearch,list_pages,query,resolve_slugsand others viactx.sourceId/allowedSources, so code reads can follow the same path rather than being suspended wholesale.code:read) so a token can opt in without loosening the default for every caller.expand-type-filter/ the remote read policy and remove the suspension when raw fragments are covered.If none of those are wanted yet, a smaller fix would still help: return the CLI fallback in the error, so a caller that hits the gate knows the capability exists and how to reach it.
Alternatives considered
repo:garrytan/gbrain "code reads suspended"returns 0 results), so "later" has no owner.Note on scope: this is filed per the docstring's own framing — code reads are the one gap a general MCP user hits hardest, because an agent that cannot answer "who calls this function" cannot safely edit code, and that is the flagship use of the code graph the sync lane spends real effort building.
All reactions