Skip to content

Conversation

@johnlanda
Copy link
Contributor

@johnlanda johnlanda commented Aug 18, 2025

Adds PKCE support for Tetrate Agent Router Service, similar to openrouter PKCE signup flow

Tetrate when signed up via a "work address" currently will give goose users starter credit, which is ideal.

Screenshot 2025-08-21 at 2 38 04 pm

@michaelneale michaelneale marked this pull request as ready for review August 18, 2025 23:49
@michaelneale michaelneale marked this pull request as draft August 18, 2025 23:49
@michaelneale michaelneale self-assigned this Aug 19, 2025
@johnlanda johnlanda force-pushed the pkce-tars branch 2 times, most recently from 3284865 to 8f3774a Compare August 19, 2025 03:44
@michaelneale michaelneale changed the base branch from main to micn/main August 19, 2025 05:42
@michaelneale michaelneale changed the base branch from micn/main to main August 19, 2025 05:42
@michaelneale
Copy link
Collaborator

ok I pushed a fix to your branch to make it compile (small change on main with api) - but I can't seem to make it work with credits (I think). I can sign on, allw orks great, but I have 0 credit so it fails with an error message if I try to use it. In one case I used github, in another used my gmail - which I guess would be most obvious things people do - is there something else we need to do?

Provider request failed with status: 500 Internal Server Error. Payload: Some(Object {"error": String("internalservererror"), "message": String("Internal server error, please try again later")}). Returning error: ServerError("Some(Object {\"error\": String(\"internalservererror\"), \"message\": String(\"Internal server error, please try again later\")})")

I assume due to a balance of zero (I can see it in both accounts if I log in)? (it would need a non zero balance for it to work I guess?) - or am I seeing another bug with the flow and it didn't save the token?

@@ -0,0 +1,349 @@
use anyhow::{Error, Result};
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this makes sense, as there is some tetrate specific handling between models going on here?

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'm going to simplify this a bit. We don't use the same prefixes and I don't think we need the cache control portion for anthropic either.

I followed this pattern from the openrouter one as I think we may find some nuances in model handling as we test. If we don't have a need for this, I can pull it out in favor a more generic openai compat provider or something like that.

@michaelneale
Copy link
Collaborator

so far - seems ok, follows exactly the same patterns as the openrouter sign up with PKCE

@johnlanda
Copy link
Contributor Author

ok I pushed a fix to your branch to make it compile (small change on main with api) - but I can't seem to make it work with credits (I think). I can sign on, allw orks great, but I have 0 credit so it fails with an error message if I try to use it. In one case I used github, in another used my gmail - which I guess would be most obvious things people do - is there something else we need to do?

Provider request failed with status: 500 Internal Server Error. Payload: Some(Object {"error": String("internalservererror"), "message": String("Internal server error, please try again later")}). Returning error: ServerError("Some(Object {\"error\": String(\"internalservererror\"), \"message\": String(\"Internal server error, please try again later\")})")

I assume due to a balance of zero (I can see it in both accounts if I log in)? (it would need a non zero balance for it to work I guess?) - or am I seeing another bug with the flow and it didn't save the token?

I believe that TARS is set to give $5 credits to business emails at the moment. Let me know if you need me to arrange for some credits to test on the backend.

@michaelneale
Copy link
Collaborator

thanks @johnlanda looks like a bit of conflict resolving to do still - some deeper changes on main, if you get to it? but looking good.

@johnlanda
Copy link
Contributor Author

@michaelneale I think I have all the conflicts sorted with the latest on main. Let me know if you have a chance to take another look!

Signed-off-by: John Landa <[email protected]>
@michaelneale
Copy link
Collaborator

taking a look shortly!

@michaelneale
Copy link
Collaborator

thanks @johnlanda - if you ask goose to run ./scripts/clippy-lint.sh and fix it - it will take care of those final things.

Signed-off-by: John Landa <[email protected]>
@michaelneale
Copy link
Collaborator

oh sometimes to see the test codepath errors I need to run cargo test --jobs 2 locally

Signed-off-by: John Landa <[email protected]>
@michaelneale michaelneale marked this pull request as ready for review August 21, 2025 02:31
@michaelneale michaelneale added p1 Priority 1 - High (supports roadmap) onboarding Setup/configuration/first-time user experience labels Aug 21, 2025
…-pkce-tars

* 'pkce-tars' of github.com:johnlanda/goose:
  test cleanup
  run clippy lint script
  cargo fmt
  Simplify tetrate provider
  fmt
  Add ui PKCE flow for TARS
  Add PKCE support for Tetrate Agent Router Service
@michaelneale
Copy link
Collaborator

michaelneale commented Aug 21, 2025

ok this looks really great.

Screenshot 2025-08-21 at 2 38 04 pm

could make this the recommended one, especially if it sends people to sign up to get the credits

@johnlanda could change some wording, and make tetrate recommended? Wording could be similar to openrouter "get instant access to AI models, get started for free, automatically configured"? also is there an icon to use?

@michaelneale michaelneale requested a review from a team as a code owner August 21, 2025 05:01
@michaelneale michaelneale changed the base branch from main to micn/main August 21, 2025 05:01
@michaelneale michaelneale changed the base branch from micn/main to main August 21, 2025 05:01
@michaelneale michaelneale removed the request for review from a team August 21, 2025 05:02
@michaelneale
Copy link
Collaborator

michaelneale commented Aug 21, 2025

ok changed some wording and updated:

image

cc @spencrmartin this has now another card - which pushes "others" below the fold I believe - any thoughts on that?
if we remove the <OpenRouter> and ollama icons, there is enough space to stack, that is one option for now (as it is now it says to scroll, I fixed that, so that is ok too)

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.

tested it every which way, and works well. Some follow ons before promoting to make sure people get sent to the right "get free credit" path, but very nice!

@michaelneale michaelneale merged commit e86c7dd into block:main Aug 21, 2025
14 of 15 checks passed
michaelneale added a commit that referenced this pull request Aug 21, 2025
* main:
  Add PKCE support for Tetrate Agent Router Service (#4165)
  Read AGENTS.md by default (#4232)
  docs: configure provider and model (#4235)
  docs: add figma tutorial (#4231)
  Add Nix flake for reproducible builds (#4213)
  Enhanced onboarding page visual design (#4156)
  feat: adds mtls to all providers (#2794) (#2799)
katzdave added a commit that referenced this pull request Aug 21, 2025
* 'main' of github.com:block/goose:
  chore: upgrade rmcp to 0.6.0 (#4243)
  doc: uvx not npx (#4240)
  Add PKCE support for Tetrate Agent Router Service (#4165)
  Read AGENTS.md by default (#4232)
  docs: configure provider and model (#4235)
  docs: add figma tutorial (#4231)
  Add Nix flake for reproducible builds (#4213)
  Enhanced onboarding page visual design (#4156)
  feat: adds mtls to all providers (#2794) (#2799)
  Don't show a confirm dialog for quitting (#4225)
  Fix: Missing smart_approve in CLI /mode help text and error message (#4132)
lifeizhou-ap added a commit that referenced this pull request Aug 22, 2025
* main: (108 commits)
  Remove unused game (#4226)
  fix issue where app redirects to home after initialization but user has already started a chat (#4260)
  Feat: Let providers configure a fast model for summarization (#4228)
  docs: update tool selection strategy (#4258)
  feat: upgrade `@mcp-ui/client` package and improve UI message handling (#4164)
  stop replacing chat window when changing working directory (#4200)
  Only fetch session tokens when chat state is idle to avoid resetting during streaming (#4104)
  bump timeouts for e2e tests (#4251)
  docs: custom context files improvements (#4096)
  chore: upgrade rmcp to 0.6.0 (#4243)
  doc: uvx not npx (#4240)
  Add PKCE support for Tetrate Agent Router Service (#4165)
  Read AGENTS.md by default (#4232)
  docs: configure provider and model (#4235)
  docs: add figma tutorial (#4231)
  Add Nix flake for reproducible builds (#4213)
  Enhanced onboarding page visual design (#4156)
  feat: adds mtls to all providers (#2794) (#2799)
  Don't show a confirm dialog for quitting (#4225)
  Fix: Missing smart_approve in CLI /mode help text and error message (#4132)
  ...
michaelneale added a commit that referenced this pull request Aug 22, 2025
* main:
  docs: update View/Edit Recipe menu item name (#4267)
  Remove unused game (#4226)
  fix issue where app redirects to home after initialization but user has already started a chat (#4260)
  Feat: Let providers configure a fast model for summarization (#4228)
  docs: update tool selection strategy (#4258)
  feat: upgrade `@mcp-ui/client` package and improve UI message handling (#4164)
  stop replacing chat window when changing working directory (#4200)
  Only fetch session tokens when chat state is idle to avoid resetting during streaming (#4104)
  bump timeouts for e2e tests (#4251)
  docs: custom context files improvements (#4096)
  chore: upgrade rmcp to 0.6.0 (#4243)
  doc: uvx not npx (#4240)
  Add PKCE support for Tetrate Agent Router Service (#4165)
  Read AGENTS.md by default (#4232)
  docs: configure provider and model (#4235)
michaelneale added a commit that referenced this pull request Aug 22, 2025
* main: (42 commits)
  feat: Add message queue system with interruption handling (#4179)
  Start extensions concurrently  (#4234)
  Add X-Title and referer headers on exchange to tetrate (#4250)
  docs: update View/Edit Recipe menu item name (#4267)
  Remove unused game (#4226)
  fix issue where app redirects to home after initialization but user has already started a chat (#4260)
  Feat: Let providers configure a fast model for summarization (#4228)
  docs: update tool selection strategy (#4258)
  feat: upgrade `@mcp-ui/client` package and improve UI message handling (#4164)
  stop replacing chat window when changing working directory (#4200)
  Only fetch session tokens when chat state is idle to avoid resetting during streaming (#4104)
  bump timeouts for e2e tests (#4251)
  docs: custom context files improvements (#4096)
  chore: upgrade rmcp to 0.6.0 (#4243)
  doc: uvx not npx (#4240)
  Add PKCE support for Tetrate Agent Router Service (#4165)
  Read AGENTS.md by default (#4232)
  docs: configure provider and model (#4235)
  docs: add figma tutorial (#4231)
  Add Nix flake for reproducible builds (#4213)
  ...
@alexhancock alexhancock mentioned this pull request Aug 22, 2025
dorien-koelemeijer pushed a commit to dorien-koelemeijer/goose that referenced this pull request Sep 2, 2025
Signed-off-by: John Landa <[email protected]>
Co-authored-by: Michael Neale <[email protected]>
Signed-off-by: Dorien Koelemeijer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-review onboarding Setup/configuration/first-time user experience p1 Priority 1 - High (supports roadmap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants