Conversation
…direct Use a shared URL builder across scripts and update createConversation to call /v1/conversations/ with query params to avoid HTTPS->HTTP redirect failures behind reverse proxies. This also deduplicates LETTA_API_BASE handling and adds regression tests for trailing-slash behavior. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/letta_api_url.ts) to centralizeLETTA_BASE_URLnormalization and API URL construction.createConversationto call/v1/conversations/(trailing slash) withagent_idquery parameters, avoiding proxy redirect issues that can downgrade to HTTP.buildLettaApiUrl(...)and remove duplicated inline base URL construction.createConversationendpoint shape.Root cause
createConversationpreviously posted to/v1/conversations?agent_id=...(no trailing slash). Some self-hosted reverse-proxy setups redirect this to/v1/conversations/?...and emit an incorrectLocationwithhttp://, causing Node fetch redirect-follow to fail withfetch failed.Test plan
npm testscripts/letta_api_url.test.ts(base normalization, query construction, trailing slash preservation)scripts/conversation_utils.test.ts(createConversationuses/conversations/endpoint)👾 Generated with Letta Code