A failed history:open switches the main process to another project while the UI stays on the old one
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
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
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
- The user removes their OpenAI key, or signs out of ChatGPT.
- They click an old GPT chat that belongs to project B while project A is shown.
- 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.
- The current chat was closed.
- 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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PierrunoYT/patch
-
enhancement priority: low security severity: low
Difficulty 4/5 3-5 days Newbie friendliness 35/100
PierrunoYT/patch#260 ·
Maintainers usually reply within 1 day
-
bug priority: low severity: low
Difficulty 3/5 1-2 days Newbie friendliness 25/100
PierrunoYT/patch#259 · 1 comment ·
Maintainers usually reply within 1 day
-
platform: macos priority: medium security severity: low tests
Difficulty 4/5 3-5 days Newbie friendliness 15/100
PierrunoYT/patch#257 ·
Maintainers usually reply within 1 day
-
bug platform: windows priority: medium severity: medium
Difficulty 4/5 3-5 days Newbie friendliness 30/100
PierrunoYT/patch#242 · 1 comment ·
Maintainers usually reply within 1 day
-
bug priority: high severity: high
Difficulty 4/5 3-5 days Newbie friendliness 42/100
PierrunoYT/patch#240 ·
Maintainers usually reply within 1 day
All issues in PierrunoYT/patch
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openclaw/openclaw#168089 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
✨ enhancement needs-discussion
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
[Bug]: [MCP/CLI] Bare loopback IP addresses (127.0.0.1:port) and hosts with ports fail to navigate due to erroneous scheme inferencePossibly taken @alok-108 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/playwright#43263 ·
Maintainers usually reply within 1 day
-
area:studio type:security
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
enhancement good first issue Stellar Wave trivial
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
StellarCanary/ProtocolCanary-Action#331 ·
Maintainers usually reply within 1 day