Skip to content

fix: use dynamic port for Tetrate auth callback server#7228

Merged
michaelneale merged 1 commit intoblock:mainfrom
raj-subhankar:dynamic-port
Feb 15, 2026
Merged

fix: use dynamic port for Tetrate auth callback server#7228
michaelneale merged 1 commit intoblock:mainfrom
raj-subhankar:dynamic-port

Conversation

@raj-subhankar
Copy link
Contributor

Summary

  • The Tetrate login auth callback server was hardcoded to port 3000, causing failures when that port was already in use
  • Changed to bind to port 0 (OS assigned), read back the actual port, and pass it into the auth URL dynamically
  • The listener is now created by the caller and passed into run_callback_server, keeping port knowledge in one place

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Related Issues

Relates to #ISSUE_ID
Discussion: LINK (if any)

Screenshots/Demos (for UX changes)

Before:

Fixed port 3000

Goose.Tetrate.login.before.mov

After:

Dynamic port allocation

Dynamic.port.720.mov

Signed-off-by: raj-subhankar <subhankar.rj@gmail.com>
Copilot AI review requested due to automatic review settings February 15, 2026 06:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a port conflict issue in the Tetrate authentication flow by changing from a hardcoded port 3000 to dynamic OS-assigned port allocation. The solution creates the TCP listener early (binding to port 0), reads back the actual assigned port, and passes it into the auth URL. This refactoring also simplifies the code by removing the start_server() method and consolidating all server setup logic into complete_flow().

Changes:

  • Modified auth callback server to use dynamic port allocation instead of hardcoded port 3000
  • Refactored server initialization to accept a pre-created listener, keeping port knowledge centralized
  • Updated tests and examples to reflect the dynamic port behavior

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
crates/goose/src/config/signup_tetrate/server.rs Removed hardcoded port binding; run_callback_server now accepts a pre-created listener
crates/goose/src/config/signup_tetrate/mod.rs Consolidated server setup into complete_flow(); removed start_server() method; changed get_auth_url() to accept dynamic port
crates/goose/src/config/signup_tetrate/tests.rs Updated test to verify dynamic port is correctly included in auth URL
crates/goose/examples/tetrate_auth.rs Updated example documentation to reflect dynamic port allocation

Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

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

looks ok, not the easiest to hand test but lets get it in the next

@michaelneale michaelneale added this pull request to the merge queue Feb 15, 2026
Merged via the queue into block:main with commit 4a5210e Feb 15, 2026
24 of 25 checks passed
michaelneale added a commit that referenced this pull request Feb 16, 2026
* origin/main: (42 commits)
  fix: use dynamic port for Tetrate auth callback server (#7228)
  docs: removing LLM Usage admonitions (#7227)
  feat(otel): respect standard OTel env vars for exporter selection (#7144)
  fix: fork session (#7219)
  Bump version numbers for 1.24.0 release (#7214)
  Move platform extensions into their own folder (#7210)
  fix: ignore deprecated skills extension (#7139)
  Add a goosed over HTTP integration test, and test the developer tool PATH (#7178)
  feat: add onFallbackRequest handler to McpAppRenderer (#7208)
  feat: add streaming support for Claude Code CLI provider (#6833)
  fix: The detected filetype is PLAIN_TEXT, but the provided filetype was HTML (#6885)
  Add prompts (#7212)
  Add testing instructions for speech to text (#7185)
  Diagnostic files copying (#7209)
  fix: allow concurrent tool execution within the same MCP extension (#7202)
  fix: handle missing arguments in MCP tool calls to prevent GUI crash (#7143)
  Filter Apps page to only show standalone Goose Apps (#6811)
  opt: use static for Regex (#7205)
  nit: show dir in title, and less... jank (#7138)
  feat(gemini-cli): use stream-json output and re-use session (#7118)
  ...
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