grape_get_context
Call at the start of each repository task turn to fetch only the context needed now: new, changed, and pinned items, unchanged markers, and stale-context invalidations for the session.
Instructions
Call at the start of every turn on a repository task. Returns the context this session needs now: bodies for new, changed, and pinned items; markers for unchanged items this session already received; and invalidations for earlier context that is now stale. Reuse one sessionId for the whole conversation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | Repository paths you already know are relevant. They seed retrieval. | |
| query | Yes | The current request in plain language. It may change between turns. | |
| tests | No | Test files or test names related to the task. | |
| symbols | No | Function, class, or type names you already know are relevant. | |
| taskType | No | Optional task category. security_fix, refactor, and migration add stricter evidence and pinning. | |
| agentName | No | Client name, used with agentSessionId instead of sessionId. | |
| sessionId | No | Stable id for this conversation. Reuse it every turn: Grape only omits context it already sent to this session. | |
| outputMode | No | agent_pack (default) returns item bodies for acting on. full also embeds the stored artifact, dependency refs, and graph for inspection. | |
| tokenBudget | No | Optional token cap for the pack. Optional context is pruned first; required safety context is never pruned. | |
| featureFlags | No | ||
| resetSession | No | Set true when you lost earlier context, for example after compaction. Grape invalidates everything it sent this session and resends it. | |
| agentSessionId | No | The client's own conversation id, used with agentName instead of sessionId. | |
| environmentScope | No |