Skip to content

Fix missing await on generate() in ConstrainedGenerator#87

Merged
stikves merged 1 commit into
apple:mainfrom
stikves:fix/constrained-generator-await
Jul 7, 2026
Merged

Fix missing await on generate() in ConstrainedGenerator#87
stikves merged 1 commit into
apple:mainfrom
stikves:fix/constrained-generator-await

Conversation

@stikves

@stikves stikves commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #86.

ConstrainedGenerator.decode() calls InferenceEngine.generate() which is async throws, but was missing the await keyword — causing a compile error.

-            for try await output in try inferenceEngine.generate(
+            for try await output in try await inferenceEngine.generate(

@stikves stikves force-pushed the fix/constrained-generator-await branch 5 times, most recently from 55a0c55 to 9c9a425 Compare July 6, 2026 20:53
ConstrainedGenerator.decode() calls InferenceEngine.generate() which is
async throws, but was missing the await keyword.
@stikves stikves force-pushed the fix/constrained-generator-await branch from 9c9a425 to 411f935 Compare July 6, 2026 20:54
@stikves stikves self-assigned this Jul 6, 2026
@carinapeng

Copy link
Copy Markdown
Contributor

Thanks for the quick fix - also added this issue to make sure we can cover these in the future #88

@carinapeng

Copy link
Copy Markdown
Contributor

Shall we merge this soon? ToT main build is broken at the moment because of this :(
image

@stikves stikves merged commit 3f38f50 into apple:main Jul 7, 2026
3 checks passed
@stikves

stikves commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged

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.

ConstrainedGenerator.swift fails to compile: missing await after generate() became async

3 participants