Skip to content

fix: use websocket for openenv data plane calls - #9952

Open
farhann1 wants to merge 7 commits into
mainfrom
farhannawaz/rle-websocket
Open

fix: use websocket for openenv data plane calls#9952
farhann1 wants to merge 7 commits into
mainfrom
farhannawaz/rle-websocket

Conversation

@farhann1

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

Copy link
Copy Markdown

🔗 Linked Issue Required

Thanks for the contribution! Please link a GitHub issue to this PR by adding Fixes #123 to the description or using the sidebar.
No issue yet? Feel free to create one!

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the ext-rle azure.ai.rle extension label Sep 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Browser cancellation can destroy the shared session, keepalives are absent, initialization compatibility changes, and two lines fail lint limits.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds persistent WebSocket transport for stateful OpenEnv calls while retaining HTTP for safe endpoints.

Changes:

  • Shares one WebSocket session between the shell and playground.
  • Adds WebSocket protocol and lifecycle tests.
  • Expands init to select OpenEnv catalog environments.
File summaries
File Description
README.md Documents catalog environment initialization.
websocket_runtime.go Implements persistent WebSocket sessions.
websocket_runtime_test.go Tests WebSocket behavior and concurrency.
scaffold.go Generalizes OpenEnv environment checkout.
scaffold_test.go Tests generalized scaffolding.
runtime.go Adds injectable runtime caller support.
root_test.go Updates initialization tests.
invoke.go Integrates WebSockets with shell and playground.
invoke_test.go Tests remote WebSocket invocation.
init.go Changes positional initialization semantics.
go.mod Adds Gorilla WebSocket dependency.
go.sum Records dependency checksums.
extension.yaml Updates initialization example.
Review details

Suppressed comments (1)

cli/azd/extensions/azure.ai.rle/internal/project/scaffold.go:110

  • This line is 144 columns wide and will fail the repository's 125-column lll check (cli/azd/AGENTS.md:115-126). Move the detailed explanation above the command while retaining a concise nolint rationale.
	process := exec.Command("git", args...) //nolint:gosec // Arguments are passed directly; the user value is validated as an environment name.
  • Files reviewed: 12/13 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cli/azd/extensions/azure.ai.rle/internal/cmd/invoke.go Outdated
Comment thread cli/azd/extensions/azure.ai.rle/internal/project/scaffold.go Outdated
Comment thread cli/azd/extensions/azure.ai.rle/internal/cmd/init.go Outdated
Preserve positional init naming with an explicit OpenEnv source flag. Add bounded WebSocket keepalives and drain browser responses without allowing client disconnects to corrupt the shared session.

Authored-by: GitHub Copilot CLI v1.0.68
Model: GPT-5.4 (gpt-5.4)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 10, 2026 14:52
Use repository-recognized wording in the WebSocket drain comment.

Authored-by: GitHub Copilot CLI v1.0.68
Model: GPT-5.4 (gpt-5.4)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Connection-level OpenEnv errors are treated as recoverable even though the server closes the socket.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 12/13 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread cli/azd/extensions/azure.ai.rle/internal/project/websocket_runtime.go Outdated
Copilot AI review requested due to automatic review settings September 10, 2026 15:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The destination-preservation test currently exercises the wrong directory and cannot detect the intended regression.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

cli/azd/extensions/azure.ai.rle/internal/project/scaffold_test.go:98

  • The sentinel is created under missing_env, but the function is asked to replace target_env. This test therefore passes even if the destination replacement happens before source validation. Point sessionDir at target_env so the assertion covers the directory that force could delete.
  • Files reviewed: 12/13 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Use the positional init argument as the OpenEnv catalog selector and suggest close matches without replacing existing destinations. Treat connection-level OpenEnv errors as terminal and align client timeouts and message limits with the service contract.

Authored-by: GitHub Copilot CLI v1.0.68
Model: GPT-5.4 (gpt-5.4)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 10, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The message-size cap and breaking init semantics need resolution, alongside required Go modernization.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

cli/azd/extensions/azure.ai.rle/internal/cmd/init.go:77

  • This changes the existing azd ai rle init <name> contract: <name> previously renamed the echo sample, but it now selects a catalog entry, so scripts using custom names fail. Preserve positional naming and add a separate catalog selector, or provide an explicit compatibility path.
	sessionDir, err := checkoutOpenEnvEnvironmentFunc(envName, ".", a.flags.force)

cli/azd/extensions/azure.ai.rle/internal/project/websocket_runtime_test.go:245

  • The repository's Go 1.26 convention requires errors.AsType, and go fix is CI-enforced (cli/azd/AGENTS.md:369-395). Use the typed result directly.
	var localError *azdext.LocalError
	if err == nil || terminal || !errors.As(err, &localError) ||
		!strings.Contains(localError.Suggestion, "payload and retry") {
  • Files reviewed: 12/13 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread cli/azd/extensions/azure.ai.rle/internal/project/scaffold_test.go Outdated
Comment thread cli/azd/extensions/azure.ai.rle/internal/project/websocket_runtime_test.go Outdated
Copilot AI review requested due to automatic review settings September 10, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The no-timeout mode remains capped for playground calls, and initialization introduces a breaking argument semantic.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

cli/azd/extensions/azure.ai.rle/internal/cmd/init.go:77

  • This reinterprets the existing positional argument from a local session/RLE name into an OpenEnv catalog key. For example, the previously documented azd ai rle init code_rl copied echo_env into code_rl; it now looks for envs/code_rl and fails, breaking existing scripts and workflows. Preserve the existing name argument and add an explicit source selector (or provide a deliberate compatibility/migration path).
	sessionDir, err := checkoutOpenEnvEnvironmentFunc(envName, ".", a.flags.force)
  • Files reviewed: 12/13 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +191 to +194
if !cancelAfterSend && !hasDeadline {
deadline = time.Now().Add(c.drainTimeout)
hasDeadline = true
}
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.rle PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/9952/azure-ai-rle.zip"
  • Version: 0.4.0-preview.pr.9952.6811302
  • Merge commit: 2350c12

Copilot AI review requested due to automatic review settings September 11, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The sample supply chain is mutable and personally hosted, and initialization no longer supports non-interactive use.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

cli/azd/extensions/azure.ai.rle/internal/project/websocket_runtime_test.go:53

  • The HTTP handler appends to requests while the test goroutine later reads that slice without a lock or a handler-completion signal; safePaths and upgrades have the same issue. Network request completion does not establish a Go memory-model happens-before edge, and the server is not closed until after the assertions, so this test is racy under go test -race. Protect all three values with a mutex/atomics or send captured results through a channel before asserting.
  • Files reviewed: 14/15 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment on lines +17 to +18
rleSamplesRepoURL = "https://github.com/sujit-kamireddy/rle-samples.git"
rleSamplesRepoRef = "main"
Comment on lines +128 to +135
response, err := azdClient.Prompt().Select(azdext.WithAccessToken(ctx), &azdext.SelectRequest{
Options: &azdext.SelectOptions{
Message: "Select an RLE sample",
Choices: choices,
DisplayNumbers: new(true),
EnableFiltering: new(true),
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-rle azure.ai.rle extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants