How do I correctly to preserve conversation history when an ai bot transitions from a public-facing chat widget to a private, authenticated session within a premium app? we are building a multi-tenant integration that leverages the platform api to inject custom context into the ai agent’s prompt. the issue arises when the oauth token refreshes mid-conversation. the ai agent seems to lose the prior turn context, resulting in a generic response instead of continuing the dialogue.
we are using the latest version of the platform sdk for node.js and have configured the ai agent with a custom data action that pulls user-specific metadata. however, when the session expires and a new oauth token is issued, the ai agent does not appear to link the new request to the previous conversation id. this causes the ai to restart the flow rather than resuming.
we have verified that the conversation id is being passed in the header, but the ai agent returns a 200 ok with a blank context object. is there a specific parameter we need to include in the ai agent configuration to force context persistence across token rotations? or is this a limitation of the current ai agent architecture when dealing with multi-tenant oauth flows?
our environment is in the us-east-1 region, and we are testing against the production api endpoints. we have also checked the rate limits, and we are well within the thresholds, so this does not appear to be a throttling issue. any insights on how to properly chain these sessions without losing the ai agent’s memory would be appreciated. we want to ensure a seamless experience for our clients, especially since this is a core feature of our premium app offering.