# rfp agent hit context limit mid proposal section merge and failed to complete: how to fix it

Merging every section in one model call exceeds the context window. Merge sections pairwise, summarize each merged pair, and carry only the summaries forward.

```text
rfp agent hit context limit mid proposal section merge and failed to complete
```

## When to use this skill
- Agent hits context limit during section merge
- Merge works on short proposals but fails on long ones

## When not to use this skill
- Merge completes but loses content (a quality issue)
- Agent runs out of tokens on the first section (a sizing issue)

## Tool compatibility
Agent context management for merges. Related area: model APIs and inference.

Related area: proposal automation and agent-assisted RFP workflows.

Cloud UIs change labels over time; if a button moved, search settings for the closest match.

## Before you start
- Sign in to the tool and keep one tab open so sessions stay clean
- Copy the exact error text and note the time it happened
- Set aside 15 to 20 minutes; most of these resolve in a single pass

## Quick diagnosis
Make sure this is the right skill before you invest the 15 minutes.
- If you are dealing with agent hits context limit during section merge, start at step 1 below.
- If instead merge completes but loses content (a quality issue), stop here; you need a different skill.
- If neither quite matches, compare your screen against the verbatim error block at the top; that block is exactly what this skill covers.

## Fix it in steps
### 1. Merge sections pairwise

```
Merge two sections at a time instead of all at once.
```
Expected: Expected: each merge call fits comfortably in context.

### 2. Summarize each merged pair

```
Compress each merged pair to its key points before continuing.
```
Expected: Expected: running state stays small.

### 3. Carry summaries forward

```
Feed only the summaries plus the next raw section into each step.
```
Expected: Expected: context usage stays flat as sections grow.

### 4. Assemble the final merge

```
Combine the pairwise results into the final merged section.
```
Expected: Expected: complete merge with no context error.

## Confirm each step worked
Run through this checklist before moving on. If a check fails, redo that step instead of pushing ahead.
- Step 1 (merge sections pairwise): Expected: expected: each merge call fits comfortably in context.
- Step 2 (summarize each merged pair): Expected: expected: running state stays small.
- Step 3 (carry summaries forward): Expected: expected: context usage stays flat as sections grow.
- Step 4 (assemble the final merge): Expected: expected: complete merge with no context error.

## Quick recap
1. Merge sections pairwise
2. Summarize each merged pair
3. Carry summaries forward
4. Assemble the final merge

## Still stuck?
Gather three things: the exact error text, the time it happened, and what changed just before it broke.
Check the vendor status page for an active incident. Then open a support ticket with those three things;
it cuts the back-and-forth in half. For agent runs, attach the last 50 lines of the agent log too,
since the loop or timeout signature in the log usually names the cause.

## Variant phrasings
### agent context limit section merge
Pairwise merging fixes it. If this matches what you saw, the steps above apply as written.

### rfp agent context overflow merge
Summaries keep context flat. If this matches what you saw, the steps above apply as written.

## Why it happens
Context grows with every section loaded, so the merge that works for five sections dies on fifty. Pairwise merging with summary carry-forward keeps each call the same size regardless of total sections.

## Edge cases
- Summarize aggressively; the merge needs structure, not full prose
- Keep the raw text of the current pair; summaries of summaries degrade
- Log context usage per step so the limit is visible before it hits

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_d1JIj_j-3D20x6cWN2CqeA
