Skip to main content

handle_context

Function handle_context 

Source
pub async fn handle_context(
    server: &ProtocolServer,
    req: ContextRequest,
) -> Result<Response<ContextResponse>, Status>
Expand description

Handle a CONTEXT RPC.

  1. Validates the session (and keeps it alive).
  2. Runs a full-text search for the given query.
  3. Depending on depth:
    • SIGNATURES – return symbol metadata only.
    • FULL – also include source code.
    • CALL_GRAPH – include source code + caller/callee edges.
  4. Estimates token usage and truncates if max_tokens is set.

File reads now go through the session workspace overlay, so agents see their own in-progress modifications reflected in CONTEXT results.