Skip to content

add support for patching agent endpoints#241

Open
kmvachhani wants to merge 5 commits intomainfrom
agent-462
Open

add support for patching agent endpoints#241
kmvachhani wants to merge 5 commits intomainfrom
agent-462

Conversation

@kmvachhani
Copy link
Copy Markdown
Contributor

adds Update and UpdateUpstream to EndpointForwarder, allowing callers to mutate a running endpoint's metadata (name, description, metadata, pooling) and upstream URL without tearing down and rebinding the tunnel

@kmvachhani kmvachhani marked this pull request as ready for review April 17, 2026 20:39
@kmvachhani kmvachhani requested a review from bmpngrok April 17, 2026 20:39
Copy link
Copy Markdown
Contributor

@bmpngrok bmpngrok left a comment

Choose a reason for hiding this comment

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

Some backcompat concerns with this, plus some minor code cleanup. If I'm missing something and the backcompat concern isn't valid, I can likely kick this to an Approve, but I figured we should talk first about it

Comment thread forwarder.go
Comment thread internal/tunnel/proto/msg.go Outdated
Comment thread agent.go
a.mu.RLock()
sess := a.sess
a.mu.RUnlock()
if sess == nil {
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.

Not your fault, but this is yet another race condition with this design

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah :/

Copy link
Copy Markdown
Contributor

@bmpngrok bmpngrok left a comment

Choose a reason for hiding this comment

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

I think you're good to ship this here

}

func (s *reconnectingSession) PatchTunnelState(tunnelID string, name, description, metadata *string, poolingEnabled *bool) error {
if sess := s.firstSession(); sess != nil {
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.

This should probably technically be locked to avoid the session disappearing. I think. I'm honestly okay with you punting it if we get onto a v3 Go SDK sooner rather than later

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