Repository navigation
feat(codemode): replace Yaegi with Expr - #155
Merged
Merged
Conversation
Raezil
marked this pull request as ready for review
August 27, 2026 16:01
Contributor
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/plugins/codemode/codemode.go">
<violation number="1" location="src/plugins/codemode/codemode.go:89">
P1: When `stream.Next()` fails mid-stream, `CallToolStream` currently returns partial items with a nil error, so transport/runtime failures look like success. Handle EOF as completion and return non-EOF errors instead.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| stream, err := api.client.CallToolStream(api.ctx, name, args) | ||
| if err != nil { return nil, fmt.Errorf("CallToolStream failed: %w", err) } | ||
| items := make([]any, 0) | ||
| for { item, err := stream.Next(); if err != nil { return items, nil }; items = append(items, item) } |
Contributor
There was a problem hiding this comment.
P1: When stream.Next() fails mid-stream, CallToolStream currently returns partial items with a nil error, so transport/runtime failures look like success. Handle EOF as completion and return non-EOF errors instead.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/plugins/codemode/codemode.go, line 89:
<comment>When `stream.Next()` fails mid-stream, `CallToolStream` currently returns partial items with a nil error, so transport/runtime failures look like success. Handle EOF as completion and return non-EOF errors instead.</comment>
<file context>
@@ -1,567 +1,160 @@
+ stream, err := api.client.CallToolStream(api.ctx, name, args)
+ if err != nil { return nil, fmt.Errorf("CallToolStream failed: %w", err) }
+ items := make([]any, 0)
+ for { item, err := stream.Next(); if err != nil { return items, nil }; items = append(items, item) }
+}
+
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the Go/Yaegi CodeMode runtime with Expr on
feat/expr-codemode.codemoderuntime APIletCallToolStreamSummary by cubic
Replaces the CodeMode Go/Yaegi interpreter with
expr-lang/expr, so generated workflows are now Expr expressions instead of Go-like snippets. Code that relied on__out, imports, type assertions, or manual stream loops must be rewritten; tool whitelist validation and orchestration caching stay unchanged.github.com/expr-lang/exprv1.17.8, dropsgithub.com/traefik/yaegi, and makes the orchestrator fully Expr-native.codemodeAPI object, with no Go imports or Yaegi stdlib.codemode.CallToolStreamcollects streaming chunks into an array instead of a manual iterator.Migration
let-bound sequential expressions where the last expression is the result.codemode.Getinstead of Go type assertions.return/__outpatterns with the expression-oriented result model.Written for commit 73be66c. Summary will update on new commits.