Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

A failed history:open switches the main process to another project while the UI stays on the old one

Closed
#161 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
61/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend, desktop

Research direction

Start with src/main/chat_manager.ts around ChatManager.open and trace session creation through src/main/llm/index.ts; then inspect the history:open handler in index.ts around lines 316–321. Add a test for opening a chat without a provider key while another project and session are active. Done when the failed open leaves both unchanged and the renderer stays in sync.

Written by the indexing model from the issue text.

Description

bug priority: high severity: high

Found in the 2026-10-07 code review (traced through the code).

Problem

ChatManager.open (src/main/chat_manager.ts:164-177) runs projects.open(saved.projectPath), then projectChanged(), then closeSession(), and only then createSession(saved). createSession → llm.restoreConversation → build throws MissingApiKeyError (src/main/llm/index.ts:101,111) when the saved chat's provider has no key. The history:open handler (index.ts:316-321) throws before it sends project:changed.

Scenario

  1. The user removes their OpenAI key, or signs out of ChatGPT.
  2. They click an old GPT chat that belongs to project B while project A is shown.
  3. A toast shows the key error. The main process is now in B with no session, but the header, drafts and git panel still show A.
  4. The current chat was closed.
  5. The next message starts an agent that edits files and runs commands in B. The files list, editor links, terminal and git panel also resolve against B.

Fix

Create the session before changing anything, and always resync the renderer:

const next = this.createSession(saved);       // throws before any state changes
this.deps.projects.open(saved.projectPath);
this.projectChanged();
this.closeSession();
this.session = next;
handle('history:open', (id) => {
  try { return manager.open(id); }
  finally { send(mainWindow, 'project:changed', projects.current()); }
});

Optionally allow read-only viewing of a chat whose provider has no key. Add a test: open() of a chat without a key leaves the current project and session unchanged.

Dominant language
TypeScript
Stars
2
Forks
2
Avg merge
5h 28m
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PierrunoYT/patch

All issues in PierrunoYT/patch

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.