Skip to content

Conversation

@ssncferreira
Copy link
Contributor

No description provided.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ssncferreira ssncferreira force-pushed the ssncferreira/feat-add-aiproxy-core branch from 11a58c6 to f095630 Compare December 16, 2025 20:27
@ssncferreira ssncferreira force-pushed the ssncferreira/feat-add-aiproxy-core branch from f095630 to a6abd82 Compare December 16, 2025 20:50
Flag: "aiproxy-listen-addr",
Env: "CODER_AIPROXY_LISTEN_ADDR",
Value: &c.AI.ProxyConfig.ListenAddr,
Default: ":8888",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if there is a better standard for a proxy port 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

8080is kinda common because HTTP is 80, but I don't think it matters.

I think we listen on 8080 already for our web frontend in dev mode; might make things complicated.

Value: &c.AI.ProxyConfig.KeyFile,
Default: "",
Group: &deploymentGroupAIProxy,
YAML: "key_file",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to confirm, do we need to set this as a secret? Something like: Annotations: serpent.Annotations{}.Mark(annotationSecretKey, "true"),
This is the file path, so the content is the actual secret 🤔

Value: &c.AI.ProxyConfig.ListenAddr,
Default: ":8888",
Group: &deploymentGroupAIProxy,
YAML: "listen_addr",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if we have a convention for yaml between snake_case and camelCase, as I see some options of aibridge with both, for instance, rateLimit and inject_coder_mcp_tools

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, it should be underscore.

Would you mind raising an issue to address these inconsistencies with rateLimit?

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Looking good 👍

Needs some basic test coverage please, and the renaming that we discussed offline.

Flag: "aiproxy-listen-addr",
Env: "CODER_AIPROXY_LISTEN_ADDR",
Value: &c.AI.ProxyConfig.ListenAddr,
Default: ":8888",
Copy link
Contributor

Choose a reason for hiding this comment

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

8080is kinda common because HTTP is 80, but I don't think it matters.

I think we listen on 8080 already for our web frontend in dev mode; might make things complicated.

Value: &c.AI.ProxyConfig.ListenAddr,
Default: ":8888",
Group: &deploymentGroupAIProxy,
YAML: "listen_addr",
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, it should be underscore.

Would you mind raising an issue to address these inconsistencies with rateLimit?

// Decrypt all HTTPS requests via MITM. Requests are forwarded to
// the original destination without modification for now.
// TODO(ssncferreira): Route requests to aibridged
// See https://github.com/coder/internal/issues/1181
Copy link
Contributor

Choose a reason for hiding this comment

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

In stacked PRs, we sometimes refer to "upstack" and "downstack".

In this comment you could mention that this will be "implemented upstack", to distinguish it from something we're not gonna do now but at some nebulous point in the future.

return certFile, keyFile
}

func TestNew(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is good but it's not validating the actual behaviour.

Can you add a test which exercises the proxy? i.e. that it actually tunnels to some mock handler?

It can be simple since we'll be doing a lot more upstack.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was planning to add more detailed tests on the following upstack PRs, but that is a good callout.
Addressed in feca199

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.

3 participants