Skip to content

Cloud integrations rework (NATS/CloudKit/Telegram)#138

Closed
RaistlinMuc wants to merge 5 commits intoDimillian:mainfrom
RaistlinMuc:ilass/integrations-rework
Closed

Cloud integrations rework (NATS/CloudKit/Telegram)#138
RaistlinMuc wants to merge 5 commits intoDimillian:mainfrom
RaistlinMuc:ilass/integrations-rework

Conversation

@RaistlinMuc
Copy link

Summary

This PR is a cleaned-up, rebased rework of our cloud integrations with the goal of staying as close to upstream as possible.

  • Adds optional remote runner support via Cloud providers (NATS / CloudKit) while keeping defaults unchanged.
  • Adds optional Telegram bot integration (pairing + status/thread selection) behind settings.
  • Expands NATS authentication options (URL auth, username/password, .creds).
  • Fixes a UI duplicate-assistant-message edge case caused by merging streaming items with thread/resume snapshots.
  • Improves iOS/iPad theme consistency when Theme = System.

Behavior / Defaults

  • Default cloud provider remains local.
  • Telegram integration is disabled by default.
  • Credentials/tokens are configured locally via Settings (no secrets committed).

Implementation Notes

  • Frontend: Settings → Cloud is organized and includes NATS auth mode + Telegram register link.
  • Backend: NATS uses explicit connect options; Telegram is implemented as a poller and persists pairing state.

Testing

  • npm run lint
  • npm run test
  • npm run typecheck
  • Manual smoke: npm run tauri dev on macOS, iPad build/install/launch via tauri ios build.

Supersedes

Closes previous WIP PRs (now closed): #31 and #45.

@Dimillian
Copy link
Owner

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f588b4332a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 501 to +505
export async function updateAppSettings(settings: AppSettings): Promise<AppSettings> {
return invoke<AppSettings>("update_app_settings", { settings });
const updated = await invoke<AppSettings>("update_app_settings", { settings });
cachedAppSettings = updated;
cachedRunnerId = null;
cachedRunnerIdAt = 0;

Choose a reason for hiding this comment

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

P2 Badge Resubscribe runner events after cloud setting changes

After settings updates, cachedRunnerId is cleared but subscribedRunnerId is not. Because getRunnerId() only calls cloud_subscribe_runner_events when the discovered runner id differs, changing NATS URL/auth while keeping the same runner id will leave the event listener attached to the old connection. In that scenario, live events/streaming updates stop or keep hitting the wrong server until a restart. Consider resetting subscribedRunnerId (or forcing a resubscribe) when settings change.

Useful? React with 👍 / 👎.

Comment on lines +482 to +486
if (item.kind === "message" && item.role === "assistant") {
const key = messageDedupKey(item);
const count = key ? remoteTailMessageCounts.get(key) ?? 0 : 0;
if (count > 0) {
remoteTailMessageCounts.set(key as string, count - 1);

Choose a reason for hiding this comment

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

P2 Badge Do not drop legitimate assistant repeats in merge

The new tail de‑duplication drops any local assistant message whose text matches a recent remote assistant message, regardless of id. If the assistant legitimately sends the same reply text in consecutive turns (e.g., "OK" or repeated acknowledgments) and the newer message is only in localItems, it will be filtered out here and the UI loses a real message until a fresh snapshot arrives (or permanently if it never does). This makes thread history inaccurate.

Useful? React with 👍 / 👎.

@RaistlinMuc
Copy link
Author

@Dimillian
Should I do something/change something here?
If yes tell me what, if no, just let codex handle the task and get it done.

@Dimillian
Copy link
Owner

Dimillian commented Jan 23, 2026

I think it's fine to keep as a fork right now.
I want to design my own gate away and app eventually just too big to merge in the codebase for now as it's moving too much.

@RaistlinMuc
Copy link
Author

🫡

@Dimillian Dimillian closed this Jan 30, 2026
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.

2 participants