Skip to content

AI model stuck indefinitely when using Read Search View/Rg tool calls #4982

Description

@npechett-wtg

Describe the bug

Copilot CLI 1.0.88 (Linux, gpt-6-sol): intermittent in-chat parallel-tool stall.
Expected: ten file reads/searches finish.
Actual: sometimes none finish until the user interrupts.
Identical batches both succeed and stall.
Cause unknown.

Affected version

No response

Steps to reproduce the behavior

### COPY THIS INTO A FRESH COPILOT CLI CHAT:

Run the setup command ONCE with the shell tool. Replace ROOT below with its
printed REPRO_ROOT. Submit all ten view/rg calls in ONE parallel chat batch
in the exact order shown. If they complete, repeat the IDENTICAL batch in
the next turn; KEEP GOING UNTIL IT STALLS. Do not stop after successes or set
a retry limit. The user will interrupt a stalled batch. Do not start another
batch while stalled. Do not launch another copilot process, use a Search
subagent, or run the ten calls via shell.

python3 - <<'PY'
from pathlib import Path
import tempfile

root = Path(tempfile.mkdtemp(prefix='copilot-parallel-generic-'))
files = [
('web/pages/Orders.jsp', 1088, 46, '<script> function updateField() { var x = getValue(); } </script>', '\n'),
('web/pages/FormHandlers.jspf', 1166, 33, 'function onChange() { return event.target.value; }', '\r\n'),
('src/main/java/com/example/web/OrderDetail.java', 3664, 35, 'private String value = lookupResult(); // generated placeholder', '\n'),
('src/main/java/com/example/data/OrderRepository.java', 10195, 41, 'private String value = lookupResult(); // generated placeholder', '\n'),
]
for name, count, average, default, newline in files:
path = root / name
path.parent.mkdir(parents=True, exist_ok=True)
lines = []
for i in range(1, count + 1):
text = default
if name.endswith('OrderDetail.java') and i % 37 == 0:
text = 'void populateFieldMap() { getFieldObject("ORDER_FIELD.VALUE"); }'
elif name.endswith('OrderRepository.java') and i % 47 == 0:
text = 'RepositoryUtil.standardizeFieldNames(); setFields();'
width = max(1, average + (i * 37) % 71 - 35)
lines.append((text + ' field = normalize(value);' * 12)[:width])
path.write_bytes((newline.join(lines) + newline).encode('ascii'))
print('REPRO_ROOT=' + str(root))
for name, _, _, _, _ in files:
path = root / name
print(name, len(path.read_bytes()), 'bytes')
PY

Use native tools; for rg set output_mode="content" and -n=true throughout:

  1. view path=ROOT/web/pages/Orders.jsp view_range=[740,825]
  2. view path=ROOT/web/pages/FormHandlers.jspf view_range=[925,1120]
  3. view path=ROOT/src/main/java/com/example/web/OrderDetail.java view_range=[2570,2690]
  4. rg paths=ROOT/src/main/java/com/example/web/OrderDetail.java
    pattern='void populateFieldMap|populateFieldMap(|getFieldObject|ORDER_FIELD.VALUE' head_limit=55
  5. rg paths=ROOT/src/main/java/com/example/data/OrderRepository.java
    pattern='getOrders(long accountId|RepositoryUtil.standardizeFieldNames|setFields(' head_limit=25
  6. view path=ROOT/web/pages/Orders.jsp view_range=[765,790]
  7. view path=ROOT/web/pages/FormHandlers.jspf view_range=[971,1006]
  8. view path=ROOT/src/main/java/com/example/web/OrderDetail.java view_range=[2600,2640]
  9. rg paths=ROOT/src/main/java/com/example/web/OrderDetail.java
    pattern='populateFieldMap|lookupResult|ORDER_FIELD' head_limit=12
  10. rg paths=ROOT/src/main/java/com/example/data/OrderRepository.java
    pattern='standardizeFieldNames|setFields|normalize(' head_limit=12

After all steps, KEEP RUNNING THE SAME TEN-CALL PARALLEL BATCH UNTIL IT
GETS STUCK. Do not stop after successful batches; the user will interrupt.

After interruption, report the stalled batch start time, tool completions,
and version. Logs: ~/.copilot/logs/process-1790592807262-37858.log and
~/.copilot/session-state/397d59e2-15bf-4098-a4ef-8ebb209fd695/events.jsonl
(inspect/redact logs before sharing; they may include unrelated private data).

Expected behavior

Stuck forever for 10 secs search call. Fix please.
Happening frequently in session.

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions