Skip to content

Archive projects and folders instead of deleting them (+1 more) - #71

Merged
ehonis merged 1 commit into
mainfrom
sync/private-main
Nov 25, 2026
Merged

ehonis merged 1 commit into
mainfrom
sync/private-main

Conversation

@ehonis

@ehonis ehonis commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Published from the private repository by oss-sync.

  • Composer: $ghost, $ folders, $opus models, $pin and $snooze
  • Archive projects and folders instead of deleting them

51 files changed, 1129 insertions(+), 202 deletions(-)

Published from the private repository by oss-sync.

- Composer: $ghost, $<name> folders, $opus models, $pin and $snooze
- Archive projects and folders instead of deleting them

 51 files changed, 1129 insertions(+), 202 deletions(-)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T14:58:10.840921Z 017dd04 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ehonis
ehonis merged commit ae5d146 into main Nov 25, 2026
4 checks passed
@ehonis
ehonis deleted the sync/private-main branch November 25, 2026 14:48

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

Copy link
Copy Markdown

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: 017dd04306

ℹ️ 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 517 to +519
if (id !== activeId) {
setDraftPick(null)
setStartOpts(null)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore start options when the first send is refused

When a new chat using $pin or $snooze receives a pre-run refusal (for example, a 4xx from /api/chat), takeForSend() restores the draft text through onRefused, but this immediately clears the associated start options. The retry therefore silently loses its pin/snooze semantics, and the optimistic “Sent … Back …” toast may already have told the user otherwise. Preserve these options until the run starts successfully, or restore them alongside the refused draft.

Useful? React with 👍 / 👎.

Comment on lines +111 to +113
} catch (e: any) {
pushError(`Couldn't make “${d.name}”: ${e?.message || e}`)
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Put the destination token back after creation fails

If creating a $tax-returns folder/project fails because the bridge rejects the request or is unreachable, pickDestination has already saved the draft with the $… token removed, and this catch only reports the error. The user is left with a modified draft and cannot retry the same creation without retyping the destination; restore the pre-selection text on this failure path.

Useful? React with 👍 / 👎.

Comment thread bridge.mjs
// Put away whole (chat/projects.mjs): its files, memory and chats stay as they are.
if ((sub === '/archive' || sub === '/restore') && req.method === 'POST') {
try {
const project = sub === '/archive' ? await projectStore.archive(id) : await projectStore.restore(id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject archived folders when filing new tasks

When a project is archived, its project.json deliberately remains on disk, but the todo services at bridge.mjs:17227 and mcp-gateway.mjs:558 still use mere file existence for folderExists. A stale client or direct API/MCP caller can therefore create or move a task into the archived ID; it is then shown as Personal while retaining a folder that suddenly reappears on restore. Make these validators use the archive-aware active check.

AGENTS.md reference: AGENTS.md:L95-L95

Useful? React with 👍 / 👎.

Comment thread bridge.mjs
if (body.needsReply === false) dismissChatPush(id)
// A chat moved into a project brings its files with it.
if (thread.projectId && !thread.projectContextOff && before && before.projectId !== thread.projectId && await projectStore.get(thread.projectId)) {
if (thread.projectId && !thread.projectContextOff && before && before.projectId !== thread.projectId && await projectStore.active(thread.projectId)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate the project before moving a chat

When a stale client moves a chat to a project archived on another device, writeThread has already persisted body.projectId before this active() check. The condition only skips copying attachments, so the request succeeds while the chat disappears from the lists with an archived project ID and its files were never brought over. Validate the destination before writeThread, or reject and roll back the move.

AGENTS.md reference: AGENTS.md:L95-L95

Useful? React with 👍 / 👎.

Comment thread bridge.mjs
const inUse = (hidden) => (t) => !t.projectId || !hidden.has(t.projectId)
const listThreads = async () => {
const hidden = await archivedProjectIds()
return (await taskDone.decorate((await threadStore.list()).filter(inUse(hidden)))).map(signThread)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Hide archived chats from the agent thread list

This filtering only covers the dashboard thread endpoints; totem_threads_list at bridge.mjs:13547 still passes active projects together with every row from threadStore.list() to listOtherThreads. With no project filter, chats from an archived project are therefore returned to agents and represented as Home with a null project ID, exposing content the owner put away. Apply the same archived-ID filter to the agent listing.

AGENTS.md reference: AGENTS.md:L95-L95

Useful? React with 👍 / 👎.

Comment thread bridge.mjs
Comment on lines +11497 to +11499
if ((sub === '/archive' || sub === '/restore') && req.method === 'POST') {
try {
const project = sub === '/archive' ? await projectStore.archive(id) : await projectStore.restore(id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep DELETE as an archive alias for loaded clients

After the bridge deploys, an already-open web bundle and older installed native builds still call DELETE /api/chat/projects/:id, but this handler now only accepts POST .../archive, so those clients fall through to a 405 and their project removal action stops working until they update. Preserve the old DELETE route as an archive-compatible alias, including the response shape old clients expect.

AGENTS.md reference: AGENTS.md:L431-L431

Useful? React with 👍 / 👎.

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.

1 participant