Skip to content

feat(staged): make hidden child note chats read-only - #1050

Draft
matt2e wants to merge 1 commit into
mainfrom
disably-sending-messages-in-hidden-child-chats
Draft

matt2e wants to merge 1 commit into
mainfrom
disably-sending-messages-in-hidden-child-chats

Conversation

@matt2e

@matt2e matt2e commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Child notes (those with parent_project_note_id set) are aggregated under their project note and hidden from the branch card and the project notes list, so their chats should not accept new user messages. This PR makes those chats read-only on both the desktop and web paths.

Backend

  • Adds a shared ensure_session_chat_writable gate in session_commands.rs, keyed on the same parent_project_note_id linkage that list_notes_for_branch hides by.
  • The gate refuses resume_session, queue_session_message and send_session_message_now for such sessions with a clear error, on the desktop commands and the web dispatch arms alike.
  • The project MCP server's continue_repo_session reaches route_continue_session directly and is unaffected.

UI

  • SessionChatPane looks up the linked branch note beside the session row. For a child note it replaces the composer with a short read-only notice and hides the Resume and note follow-up buttons. Existing messages stay viewable.

Tests

  • Gate behaviour for child, standalone and note-less sessions.
  • send_session_message_now refusing before routing, with nothing queued.
  • The web queue_session_message arm running the gate before its insert.
  • Component test for the pane's composer vs. read-only notice rendering.

🤖 Generated with Claude Code

Child notes (`parent_project_note_id` set) are aggregated under their
project note and hidden from the branch card and project notes list, so
their chats should not take new messages from the user.

Backend: a shared `ensure_session_chat_writable` gate, keyed on the same
`parent_project_note_id` linkage `list_notes_for_branch` hides by,
refuses `resume_session`, `queue_session_message` and
`send_session_message_now` for such sessions on both the desktop and
web paths with a clear error. The project MCP server's
`continue_repo_session` reaches `route_continue_session` directly and
is unaffected.

UI: `SessionChatPane` looks the linked branch note up beside the
session row and, for a child note, replaces the composer with a short
read-only notice and hides the Resume and note follow-up buttons.
Existing messages stay viewable.

Tests cover the gate (child, standalone and note-less sessions), the
send-now body refusing before routing, the web queue arm running the
gate before its insert, and the pane's composer/notice rendering.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 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-09T13:37:58.042876Z 1dcced0 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.

@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: 1dcced0e72

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

branch_id: Option<String>,
acp_config_selection: Option<store::AcpConfigSelection>,
) -> Result<ResumeSessionOutcome, String> {
ensure_session_chat_writable(&store, &session_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 Gate queued-message resumes for child notes

Gate send_queued_session_message_for_store and the automatic queue drain as well as this direct-resume wrapper. Existing installations can already contain follow-ups queued for a running child-note session; when that turn finishes, drain_queued_message_for_session calls the ungated resume_session_for_store directly, so the queued prompt starts a new turn despite the chat now being read-only. The public send_queued_session_message command has the same bypass for manually selected queued messages.

Useful? React with 👍 / 👎.

statusLoadedForSessionId = null;
const statusVersionBeforeFetch = statusEventVersion;
const id = sessionId;
void loadChatAccess(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 Refresh child-note access on revalidation

Run loadChatAccess for the revalidate path too. A pooled pane reopening the same session returns at the earlier revalidateSession() === 'settled' branch before reaching this call, so it retains the old childNoteChat value. This becomes user-visible after branch or note transfer, both of which clear parent_project_note_id: reopening the session still shows the read-only notice and hides the composer even though the backend now considers the chat writable.

Useful? React with 👍 / 👎.

@matt2e
matt2e marked this pull request as draft November 9, 2026 13:53
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