Skip to content

feat: optimize disable mode memory and persist connection URL#2

Open
kylekkkk61 wants to merge 4 commits into
Xeift:mainfrom
kylekkkk61:feature/ui-memory-and-url-fixes
Open

feat: optimize disable mode memory and persist connection URL#2
kylekkkk61 wants to merge 4 commits into
Xeift:mainfrom
kylekkkk61:feature/ui-memory-and-url-fixes

Conversation

@kylekkkk61

@kylekkkk61 kylekkkk61 commented Jun 8, 2026

Copy link
Copy Markdown

This pull request addresses several UX improvements and performance bottlenecks, making the tool much friendlier for both new and returning users, and significantly reducing memory usage for power users.

User Experience Improvements

  • Fully Persistent Connection (Slug & Domain): Users no longer have to update their ChatGPT Connector settings every time they restart CatDesk. The app now saves the mcp_slug locally. Furthermore, when a free-tier user connects, ngrok automatically assigns a persistent *.ngrok-free.dev domain. CatDesk now intercepts this URL upon the first connection and permanently saves the domain to the user's configuration, requiring zero manual input!
  • Settings (s) Menu Enhancements:
    • Added a "Connection Security URL" section allowing users to choose whether to keep their persisted slug or generate a new random one.
    • Added an "Ngrok Domain" section to view the auto-saved domain, or manually override it (e.g., if claiming a custom domain). The input prompt natively supports bracketed paste (Cmd+V / Ctrl+V) and auto-strips http://, https://, and trailing slashes so users can safely paste full URLs without causing connection errors.
    • Added vertical scrolling support to the settings menu so all options are accessible even on smaller terminal windows.
  • Smarter "What to do next?" Screen: For returning users who already have a fixed URL, the confusing 5-step "Create app" setup wizard is automatically skipped. Instead, a reassuring success message prompts them to simply send a message in ChatGPT to seamlessly connect.

Memory Optimization (Disable Mode)

  • True Headless Performance: In the original implementation, the Disable mode merely hid the TUI, but the backend still generated massive widget JSON payloads, causing the UI to lock up on "Waiting for run_command output" in long contexts. Now, when ShowDetailMode::Disable is selected, CatDesk completely skips payload generation.
  • Benchmark: In the 50+ message deep-conversation scenario mentioned in the README, actual testing shows memory usage drops significantly to around 1 GB when the UI is disabled.
  • UI Compatibility: This fix only applies to Disable mode. If a user selects Expanded or Collapsed, the rich TUI functions exactly as originally designed with full visual features.

Developer & Test Stability

  • Graceful Archive Handling: Fixed an edge-case bug in mascot.rs where an empty or corrupted binagotchy archive folder in the local cache would cause a hard error (os error 2), breaking the MCP payload generation and failing tests. Invalid folders are now gracefully ignored.
  • Dynamic Versioning: Replaced the hardcoded package version (4.0.0) in mascot.rs tests with dynamic CARGO_PKG_VERSION.
  • Test Isolation: Isolated ShowDetailMode configuration during unit testing so that a developer's local config.toml (e.g., if set to Disable) doesn't cause tests to fail.

All cargo test Passed

With these fixes, running cargo test passes 100% clean across all 69 tests.

- Fix: Disable mode now properly skips UI payload generation, resolving memory bloat and UI locking.

- Feat: Persist MCP slug in config to prevent random URL changes.

- Feat: Bootstrap guide automatically skipped for returning users.

- Fix: Isolate show_detail_mode config during tests.
@pe200012

Copy link
Copy Markdown

Have you tested the Persisted Connection URL flow yourself? In my testing, it fails to behave as described.

Persisting only the path seems insufficient for a stable endpoint. Users who need a persistent URL should first provide their own domain or custom endpoint.

@kylekkkk61

kylekkkk61 commented Jun 10, 2026

Copy link
Copy Markdown
Author

Have you tested the Persisted Connection URL flow yourself? In my testing, it fails to behave as described.

Persisting only the path seems insufficient for a stable endpoint. Users who need a persistent URL should first provide their own domain or custom endpoint.

@pe200012

Yes, I personally have been using this persistent connection for a few days to build a small project with Web GPT, and it works wonderfully. However, I indeed did not consider the fact that first-time users need their own domain recorded (because I was continuing to use it in my local development environment).

To fix this and provide the best UX, I have just pushed an update with an auto-detect feature: when a first-time user connects, CatDesk now automatically reads the persistent ngrok-free.dev domain that ngrok assigns them and permanently saves it to their configuration. I also added an input field in the terminal settings menu as a fallback/viewer if they ever want to manually change their domain or if they claim a custom one. Thanks for pointing this out!

@Xeift I've just pushed a new update that resolves the first-time user domain issue and ensures all cargo test pass cleanly. The PR is fully ready for review! Let me know if there's anything else needed for this to get merged.

@Xeift

Xeift commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Sorry for the late response. I’ll take a look this weekend

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.

3 participants