Skip to content

Cookies from an answer are stored with the async setCookie - #1138

Open
Wety14 wants to merge 3 commits into
yetanotherbrowser:mainfrom
Wety14:agents-suite-asynchronous-setCookie
Open

Wety14 wants to merge 3 commits into
yetanotherbrowser:mainfrom
Wety14:agents-suite-asynchronous-setCookie

Conversation

@Wety14

@Wety14 Wety14 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What changes

No visible change. Removes the Swift 6 "async alternative exists" warning in AgentRead.take.

Why

The completion-handler setCookie was called inside a MainActor task. The async form keeps the cookies stored in order and lets the task end once the store has them.

Proof

  • Warnings in AgentRead.swift: not measured
  • swift test --filter AnswerCookiesTests: not run
  • ./design-check --head clean
  • `swift build and swift test

Checked on

  • Not built. Needs a build on macOS 15.4+ before leaving draft.

Checklist

  • No visible change, no new menu item or Settings row
  • American English, no em dashes

AgentRead.take stores the cookies a site sets in its answer inside a
MainActor task. It called the completion-handler form of setCookie, which
Swift 6 flags because an async variant exists. Awaiting it keeps the cookies
stored in the same order, and the task now finishes when the store has them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Wety14
Wety14 marked this pull request as ready for review November 25, 2026 08:45
@Wety14
Wety14 requested a review from serafimcloud as a code owner November 25, 2026 08:45
@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge based on the reviewed changes.

Summary

Moves the existing cookie-write loop into synchronous keep, still called from a MainActor task.

  • Answer cookies are submitted through one synchronous helper.

Reviews (3) · Last reviewed commit: "Refactor keep function for cookie handli..." · Reviewed by Greptile

Comment thread Sources/Fast/AgentRead.swift Resolved
Refactor cookie handling to use a synchronous method for storing cookies.
Comment thread Sources/Fast/AgentRead.swift Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants