Skip to content

Studio: read several web pages at once on local models - #16489

Merged
danielhanchen merged 8 commits into
unslothai:mainfrom
NilayYadav:parallel-tool-calls-one-model
Nov 4, 2026
Merged

danielhanchen merged 8 commits into
unslothai:mainfrom
NilayYadav:parallel-tool-calls-one-model

Conversation

@NilayYadav

Copy link
Copy Markdown
Collaborator

When a local GGUF model asked for several web pages in one reply, Studio read them one after another, so three pages that each take 3 seconds kept the chat waiting about 10 seconds. Cloud models already read such pages together; local models did not.

Those reads now overlap on local models too, up to 4 at once and never two on the same site. Three 3 second pages take about 3.4 seconds instead of 9.6. Only the download moves earlier. Tool cards, results, the room each result gets in the context window, and what the model reads all stay in the original order and are unchanged.

This applies in Run automatically and Full access. In the modes that ask first, each page still waits for its own approval, and searches and other tools still run one at a time. If a stream closes between two tool calls, a page already started can finish in the background, for at most 60 seconds, and its result is dropped.

@danielhanchen danielhanchen added security# Moves a security boundary: sandbox, allowlist, permission or network guard new-feature# labels Nov 3, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T08:07:28.984648Z 95e17fc Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@NilayYadav NilayYadav self-assigned this Nov 3, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b236e2abc7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +15740 to +15744
with _WEB_PDF_LOCK:
# Time queued behind another read's PDF is not spent on this read.
if deadline is not None:
deadline += time.monotonic() - queued_at
pdf_text = _extract_pdf_text(raw_bytes)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recheck cancellation before parsing a queued PDF

If a multi-PDF batch is canceled while reads are waiting on _WEB_PDF_LOCK, those queued reads still invoke _extract_pdf_text when the lock becomes available; the next cancellation check happens only after extraction. An isolated _fetch_url_raw probe confirmed that the parser starts with cancel_event already set. Consequently, stopped prefetches continue performing expensive extraction serially under the global lock and can delay PDF reads in subsequent turns. Recheck cancellation after acquiring the lock and before invoking the parser, and make canceled waiters able to leave the queue.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as is. The cancelled reads' results are already thrown away, and a read in the next turn that queues behind them does not lose any of its timeout since queue time no longer counts, so the worst case is a short delay right after a stop, not a wrong or lost result.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: b236e2abc7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@LeoBorcherding

Copy link
Copy Markdown
Collaborator

I cancelled the CI runs on this PR for now, since Codex hasn't converged at the current head yet: Codex still has open findings on the head commit. CI here runs on the team's shared runner pool, and it's backed up right now (380+ runs queued), so runs on code that's still changing push everyone else's back.

Once Codex says "Didn't find any major issues" on the head commit, one push or a re-run brings CI back. A small ask going forward: hold the push until Codex is clean, and batch follow-up fixes into a single push. Thanks!

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 3, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 3, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 3, 2026
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: a898c1a8ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen danielhanchen self-assigned this Nov 4, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 95e17fccad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit ba298cd into unslothai:main Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature# security# Moves a security boundary: sandbox, allowlist, permission or network guard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants