Skip to content

Improve context share link error handling#167

Merged
ishaanxgupta merged 2 commits into
XortexAI:mainfrom
Draconna:improve-context-share-errors
May 11, 2026
Merged

Improve context share link error handling#167
ishaanxgupta merged 2 commits into
XortexAI:mainfrom
Draconna:improve-context-share-errors

Conversation

@Draconna
Copy link
Copy Markdown
Contributor

Summary

  • Preserve ChatGPT/Claude/Gemini provider detection when share links redirect
  • Add clearer errors for private, deleted, or login-redirected share links
  • Include claude.com in Claude share-link detection

Testing

  • python -m py_compile server.py

Refs #155

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors chat provider detection to handle multiple URLs and introduces a more descriptive error messaging system for failed chat scrapes. Key changes include updating _detect_chat_provider to accept variadic arguments, adding support for claude.com, and implementing _chat_share_error_message to provide provider-specific feedback. Feedback suggests mapping internal provider IDs to proper display names (e.g., 'ChatGPT' instead of 'chatgpt') in error messages to improve the user experience.

Comment thread server.py
Comment on lines +557 to +560
return (
f"Failed to extract messages from the provided {provider} share link. "
"Please confirm the link is public, exists, and is not redirecting to a login or deleted-chat page."
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The error message uses the raw provider ID (e.g., 'chatgpt'), which results in lowercase names in the UI. Mapping these to their proper display names (e.g., 'ChatGPT', 'Claude', 'Gemini') would provide a more professional and user-friendly error message.

Suggested change
return (
f"Failed to extract messages from the provided {provider} share link. "
"Please confirm the link is public, exists, and is not redirecting to a login or deleted-chat page."
)
names = {"chatgpt": "ChatGPT", "claude": "Claude", "gemini": "Gemini"}
name = names.get(provider, provider.capitalize())
return (
f"Failed to extract messages from the provided {name} share link. "
"Please confirm the link is public, exists, and is not redirecting to a login or deleted-chat page."
)

@ishaanxgupta
Copy link
Copy Markdown
Member

Hi @Draconna thank you for the contribution.
Changes looks good to me, could you share a small video of the functionality working for gemini or claude links?
also some changes will be required in landing page as well

@Draconna
Copy link
Copy Markdown
Contributor Author

Thanks! I opened the landing page PR here: XortexAI/xmem-landing#7

Attached is a short Gemini demo for the updated error-handling path. In this local run, the public Gemini share link redirects/renders as unavailable to the scraper, and the importer now surfaces the new Gemini-specific message instead of the old generic parse error.
xmem-gemini-error-demo

If you have a known public Gemini or Claude share link that should scrape successfully in your environment, I’m happy to test that too.

@ishaanxgupta
Copy link
Copy Markdown
Member

LGTM!

@ishaanxgupta ishaanxgupta merged commit d02aba5 into XortexAI:main May 11, 2026
1 check passed
@ishaanxgupta
Copy link
Copy Markdown
Member

Thank you @Draconna for the contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants