Overcoming the copilot request limit

Optimizing GitHub Copilot usage with long-running agents

February 1, 2026

When using GitHub Copilot as your daily driver, you can hit your premium requests limit really quick.

Every chat message uses one premium request multiplied by the model multiplier. Since Copilot charges per request rather than per token, sending many small questions quickly burns through your budget. To optimize spending, you need to maximize the work done in a single turn.

The downside of having long running agent is context rot. LLMs struggle to focus when overloaded with information, it is distracted by irrelevant files or failed attempts. To solve this, we need a way to keep the context window clean while still making progress.

Throwing out the Garbage

This can be achieved this by creating a variant of the Ralph loop. We can create a loop where an orchestrator agent creates subagents that implement the task. Each subagent gets specific context, completes the work, commits it, and vanishes. When it finishes, it throws out its now irrelevant context. This allows your main agent to keep a clean context and can keep on orchestrating new subagents to implement the tasks. With copilot we can do this with only one premium request.

Running the Loop

Currently, you can use your Copilot subscription in VS Code, but also on OpenCode. When using subagents in VS Code, I noticed that the main agent was still implementing changes to files. I think this is because the subagents don't have edit tools. But with OpenCode, we can run subagents that implement tasks without polluting our main agent's context. So the following implementation is optimized for OpenCode.

Main Agent Prompt

We start the loop by giving the main agent instructions to orchestrate subagents and let those work on the tasks. This is an example:

text
You are an Orchestration Agent. Your goal is to manage subagents and verify the implementation of the master plan until full completion. You do not write code; you oversee the process.

Core Workflow:

1. Initialize: Create a `progress.md` file to track subagent findings and summaries.
2. Loop: Sequentially trigger subagents using @subagent.
3. Monitor: After each subagent session, review `tasks.json`. Once every task in `tasks.json` is marked as completed, provide a concise success message and exit.

Subagent Prompt

In OpenCode, you can create custom agents which have their own prompts. The task of the subagent is to read the necessary files and select one task. The agent should then implement this task and check its work using tools like linting, building, and other tools like MCP. This is an example of a task-implementer subagent:

text
You are a Task Implementation Agent. Follow these steps:

1. Select: Pick the most critical unimplemented task from `tasks.json` based on the context in `plan.json` (this is not necessarily the first task).
2. Code: Implement the task fully. Code must be production-quality and maintainable.
3. Verify: Run tests, linting, and builds. (For frontend, use Chrome MCP for screenshots).
4. Update: If successful, set `passes: true` for the task in `tasks.json`.
5. Commit: Create a git commit with a concise message.
6. Log: Append a concise summary to `progress.md` (Tasks completed, Decisions/Why, Blockers, Files changed).
7. Exit: End your session.

This will start the implementation of your project and only costs one premium request.

Defining the Plan

The success of the loop depends on the plan you create. We will build a plan that contains the high-level structure of the project, splitting it into smaller pieces so the subagent can work on bite-sized tasks.

plan.md: This file contains the end goal of the project. Here, we add the project context along with functional and non-functional requirements.

tasks.json: This file will contain all the steps the LLM must take to reach the end goal. One way to do this is by using the feature list format from Anthropic's long-running agents harness.

json

The steps define the requirements of the task. The passes parameter can be changed by the agent once it finishes the task, signaling to the next agent what remains.

By dividing the project into smaller steps, we prevent context rot and increase the success rate.

Tips

  1. Add tasks while looping: While this loop is running, you can look at the code or something like the implemented components. If you see things you'd like to see different, you can add a task while it's looping, and it will be taken up later.
  2. Give the agent feedback loops: If you don't add feedback loops, the agent doesn't know if its implementation is correct. One way to force a feedback loop is a git pre-commit hook to run tests, linting, and build the application. This shows the agent whether the implementation is correct before committing. In the prompt I also added that the agent should take screenshots with the Chrome MCP to make sure the implementation looks correct.