Skip to content

feat: add chat_rename so an agent can rename its own session - #33736

Merged
bolichen97 merged 2 commits into
kirodotdev:mainfrom
mohamed-youssef-bou:feat/agent-self-rename
Nov 16, 2026
Merged

bolichen97 merged 2 commits into
kirodotdev:mainfrom
mohamed-youssef-bou:feat/agent-self-rename

Conversation

@mohamed-youssef-bou

@mohamed-youssef-bou mohamed-youssef-bou commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A person can ask the agent to rename the session it is running in, on the default agent and by a naming convention kept in their own instructions, without the agent ever replacing a name the person chose.

An agent on the default spec cannot rename its own session. The only agent-facing rename, session_rename, lives in the opt-in kirocrew-dashboard server, which the default spec does not mount, and it takes a target the agent has no way to learn. #13797 asked for a self-rename and was closed by #15164, which only helps agents that mount that server. So "name this session after the ticket" ends with the agent asking the person to rename it by hand.

Why it matters

People with many open sessions find their work by the sidebar title, and many keep a naming convention in their own steering or lessons (#13797's example is JIRA-XXXX — <ticket title>). Generated titles are often weak, which is why the dashboard has "Regenerate title"; the agent working in a session knows what it is about and can name it better. On the default agent it cannot do so at all, and an agent that could would have to leave a name the person typed alone.

Not a goal

What changed (motivation → approach → change)

Asking the agent to rename its session now works on the default agent in a normal dashboard chat, and the agent can never write over a name the person chose. The agent gets one new tool on kirocrew-core, the server every session carries: chat_rename(title). It renames only the session whose turn called it, and only on a turn the person sent.

It is built the way chat_tag is: the tool returns a directive, and the dashboard applies it to the slot that produced the turn, so there is no session key to look up or get wrong. It reuses session_rename's pieces: _clean_rename_title for the title rules, the same refusal codes for a session it cannot reach, and apply_manual_title, the sidebar's own write, which records the chat.manual_rename audit row with route chat_rename. The design is the accepted RFC docs/request-for-change/rfc-agent-self-rename.md (#33633).

A turn counts as the person's only when main's own checks agree: a person's actor, slot._turn_user_sent, which the dashboard clears before a peer's or an app's text is steered in, and no channel provenance. Anything else is refused as not_user_turn, a script cron's send_to_session turn included. A channel's tab is refused whether or not it is bound, and so are a conductor mode chat and a Bot's own chat, until the owner decides.

Whose name a title is comes from the title_origin every titled session already carries. The agent may replace an untitled session, a generated (auto) title, a Bot thread's name (member) or its own earlier rename, which records a new origin, agent. Every other titled origin is refused as manual_title, a missing one included. agent is final for the background titler like user, and a person's rename replaces it. Incognito and temporary sessions can rename themselves.

The first commit only moves the explicit-title helpers out of chat_title.py, which this change would otherwise take past its 2,000-line cap.

Part What it does
Tool chat_rename in mcp_tools/control_parts/schemas.py and directive.py, wired in mcp_tools/control.py; CHAT_RENAME_SCHEMA in validation_parts/core_turn_schemas.py, registered in validation_parts/server_registries.py, exported by validation.py; display title in data/mcp_tool_titles.json
Gate DIRECTIVE_TOOLS (session_directive.py) and USER_SURFACE_DIRECTIVES (directive_origin.py): the existing gates refuse a slot-less caller and a turn without the user-origin mark; dashboard/session_directive_apply.py passes the turn's actor on
Applier _apply_chat_rename in dashboard/session_directive_apply_slot.py: title rules; the slot checks (live slot, _live_target_refusal, a channel's tab, a conductor mode chat, the person checks, the title origin); the execution-record read for a Bot's own chat and the mirror probe in worker threads; the slot checks again; then the write
Title origin origin agent and _AGENT_REPLACEABLE_ORIGINS; an origin keyword on apply_manual_title; name_member_thread keeps an agent title; in mrkdwn_title.py, _TYPED_TITLE_ORIGINS gains agent
Split dashboard/chat_title_explicit.py holds generate_manual_title, apply_regenerated_title, api_chat_slot_generate_title, apply_manual_title and api_chat_slot_rename, composed onto chat_title with _facade_compose; name_member_thread and its redaction stay in chat_title.py
Memory mode _live_target_refusal (session_control_parts/target_authorization.py) takes allow_ephemeral, which waives only the memory-mode refusal
Audit and reply chat.self_rename records the title length or the refusal code, never the title, and the allowed decision is recorded before the write; the tool's reply names each refused kind of turn and session; dashboard/chat_turn/directives.py gives the not-applied line, and dashboard/session_directive_apply_outcome.py names the tool in its gate comment
Docs The RFC's conductor wording and its redaction note; the tool tables in docs/architecture/mcp.md and docs/feature-map/README.md; docs/system-specs/modules/ (security.md, session.md, learn-cron-dashboard.md); the user docs src/kiro_crew/docs/session-control.md and dashboard.md

Backwards compatibility

Compatible: additive. No existing tool, route or default changes. apply_manual_title gains an origin keyword and _live_target_refusal an allow_ephemeral keyword, both defaulting to today's behaviour, so every existing caller is unchanged. The moved helpers stay reachable as chat_title.<name>, and a test patch of a chat_title global still reaches them (test/test_chat_title_explicit_composition.py).

_TITLE_ORIGINS accepts one more value, agent, and every reader of a title_origin handles it: _persist_title and the title_origin field in slot_persistence/metadata_codec.py save it, and _rehydrate_title_origin restores it as itself; _refresh_blocked, maybe_refresh_title and refresh_forked_title treat it as final, like user; name_member_thread keeps it, so a Bot's DM thread the agent renamed keeps that title instead of taking the Bot's display name when opened; _shape_fork_child gives the fork of an agent-titled session origin user; mrkdwn_title.stored_title_is_mrkdwn keeps it as typed; _apply_chat_rename may replace it. Three writers set user directly and so replace an agent title, as a person's rename does: a fork child the caller names (session_control_parts/session_tree.py), a code-channel binding (slack/code_channels/binding.py) and a person's Slack thread rename (slack/agent_sessions/session_events.py). The frontend reads no title_origin. A version that predates agent reads a stored agent origin as user, which is final, so a downgrade cannot make an agent's title refreshable.

The split takes five public defs out of chat_title.py. Each of their readers on main still gets the same function; no app bundle, frontend file or script cron imports them, and the frontend calls the two routes by URL, which is unchanged:

  • Reader: src/kiro_crew/dashboard/chat.py:api_chat_slot_rename -- chat -- test_dashboard_chat_session_meta.py::TestSessionRename::test_rename_success
  • Reader: src/kiro_crew/dashboard/chat.py:api_chat_slot_generate_title -- chat -- test_slot_ownership_checkpoint_post_await.py::TestPostAwaitOwnership::test_title_cannot_retitle_a_replacement
  • Reader: src/kiro_crew/dashboard/routes/sessions.py:register -- chat -- binds the sidebar's rename and "Regenerate title" routes to the two chat names above; test_slot_ownership_checkpoint.py::TestEveryPerSlotRouteIsDecided::test_the_family_is_the_live_table
  • Reader: src/kiro_crew/dashboard/session_control_parts/session_titles.py:rename_target -- chat -- test_session_control_rename.py::test_a_peer_session_is_renamed_as_a_final_manual_title
  • Reader: src/kiro_crew/dashboard/session_control_parts/session_titles.py:generate_title_target -- chat -- test_session_control_generate_title.py::test_a_created_session_is_retitled_as_an_auto_title
  • Reader: src/kiro_crew/dashboard/channel_titles.py:rename_channel_title_live -- chat -- test_session_control_rename.py::test_a_channel_rename_records_its_channel_key
  • Reader: src/kiro_crew/dashboard/session_control.py:apply_manual_title -- chat -- a type-checking re-export, like apply_regenerated_title and generate_manual_title beside it; at run time _facade_mirror serves the session_titles binding, which test_chat_title_explicit_composition.py::test_an_old_import_path_binds_the_composed_function checks

Nothing else is taken away: the diff adds the tool, its schema, its applier, one title origin and one module; the edited pins add chat_rename beside the existing directive tools, and test/test_title_refresh.py swaps its example of an unknown origin from agent to another word now that agent is known.

Tests

  • test/test_chat_rename_directive.py (new, 51 tests, 71 cases) locks in:
    • the tool's payload, size bound, descriptor and reply;
    • the person checks: a marked turn with actor cron, app or crew is refused and actors "" and user rename; a turn with _turn_user_sent cleared by a peer's or an app's steer is refused; a channel-opened or channel-steered turn is refused, including after the session's mirror is removed;
    • a channel's tab refused bound or not, including one with a Slack link stored under dashboard:slack_<ts>, while a person-made slack_notes tab renames;
    • a conductor mode chat and a Bot's own chat refused: each CONDUCTOR_TEMPLATES agent, a stamped conductor mode chat, a Bot's own chat and an unreadable execution record, while a worker a Bot opened and a default-agent chat rename;
    • each refusal code session_rename uses for a session it cannot reach, incognito and temporary sessions renaming themselves, and a title set by hand or given at creation with no recorded origin kept as manual_title, before and after a reload;
    • replacement of a generated title, a Bot thread's name and the agent's own earlier rename; "Regenerate title" handing the name back; the agent origin through the real save and reload;
    • invalid titles, redaction (and a title kept as written inside the chat turn while the owner has redaction off), a failed save, the chat.self_rename line never carrying the title, the chat.manual_rename row with route chat_rename and both titles, and a close, a channel link or a person's rename landing during the mirror probe.
  • test/test_chat_title_explicit_composition.py (new, 12 tests): the moved functions run on chat_title's globals with their signatures, every global they read is bound there, facade patches reach them, and chat_title composes them once.
  • test/test_slack_title_text.py keeps an agent title as typed; test/test_title_refresh.py rehydrates agent and member as themselves and an unknown origin as user; pins updated in test/test_directive_tool_refusal_tagging.py, test/test_remote_session_local_only_tools.py, test/test_session_directive.py and test/test_validation_parts_facade.py.
  • Deterministic: the eight test files this PR adds or changes pass 20 of 20 serial runs, 10 of 10 runs under -n 4 --dist loadgroup, and a shuffled order (seed 6151).
  • Local gates on this head: pre_push_gate.py's 24 checks (black, isort, flake8, mypy src/kiro_crew/, docs-lint and the file-line cap among them), the flake-pattern ratchet, the repository's semgrep rules on the diff (0 findings), 2,522 tests from the 41 suites that name the changed directive, title-origin and schema symbols plus the facade-mirror and file-line-cap guards, 1,429 tests from the 24 suites around the moved helpers, and 196 tests from the session-control and follow-up suites that main changed beside target_authorization.py and session_directive_apply_slot.py. On an earlier base, the split commit alone passed the composition, security-posture, chat_title, member-thread, file-line-cap and facade-guard suites (433 tests); its own diff has since changed only by keeping main's new prompt_handoff import in chat_title.py.

Manual verification

Run end to end on an earlier version of this branch, before its last rebases onto main and the wording updates for conductor mode and the redaction switch, on an isolated gateway from the repository's own harness (kiro_crew.testing.harness.spawn_feature_gateway, minimal fixture, approval reads, loopback only). The default agent mounted this branch's kirocrew-core, a real model ran the turns, and each turn was sent as the dashboard user:

Step Result
In a new chat, ask the agent to rename the session to DEMO-42 · agent self-rename The agent called @kirocrew-core/chat_rename; the title reads DEMO-42 · agent self-rename, origin agent
Rename it by hand, then ask the agent to rename it Title kept; refused as manual_title
Choose "Regenerate title", then ask again Renamed, origin agent
Ask the agent to rename over its own earlier name Renamed
New incognito chat, ask the agent to rename it Renamed
Switch a chat to kirocrew-conductor, ask it to rename the session with chat_rename, and approve the prompt Refused as conductor_session; title unchanged

The agent's own reply cannot confirm the outcome in the same turn: the rename is applied after the tool returns, so the tool tells the agent to report it as requested, and the result, a refusal included, shows in the tool row. The model does not always keep to that: after the manual_title refusal above, its reply said the new name would show. A conductor still sees the tool and its approval prompt, because the conductor specs mount kirocrew-core whole; the call is refused when it is applied. Asked only to rename its session, the conductor used session_rename instead, from the kirocrew-dashboard server the conductor specs mount, and renamed itself with origin user after one approval; that is main's behaviour, which this PR does not change.

Related Issues

Closes #33624

RFC: #33633. Related: #13797, #15164, #17585, #20064, #27705, #13144.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Nov 9, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 9, 2026
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 9, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 10, 2026
@mohamed-youssef-bou

mohamed-youssef-bou commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Updated to the RFC as accepted in #33633, rebased onto main. #34667 records that acceptance in the RFC's status on main.

Two commits:

  • refactor(dashboard): move the explicit-title helpers out of chat_title moves five functions to dashboard/chat_title_explicit.py, composed onto chat_title with _facade_compose. It changes no behaviour: every chat_title.<name> import and test patch still reaches them, and a new composition test pins that. A mirror facade does not fit, because the moved code reads chat_title globals that tests patch. Without the split, the feature would take chat_title.py past its 2,000-line cap. name_member_thread and its redaction stay in chat_title.py, so the security posture's module list is unchanged.
  • The feature now makes main's own person checks: an actor in _PERSON_ACTORS, slot._turn_user_sent, and no channel provenance. A failing turn is refused as not_user_turn. It also refuses a channel's tab, bound or not, and writes chat.manual_rename with route chat_rename. agent joins _TYPED_TITLE_ORIGINS.
  • Conductors (Sign-off item 2) are left to the owner. Until that decision, the tool refuses a conductor's session as conductor_session: a Crew Mode chat, or a crewmate's conductor chat. Conductors therefore gain nothing from this PR.

An end-to-end run on a harness gateway with a real model passed every step in the body's Manual verification.

AI-assisted, sent by Kiro Crew

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 10, 2026
@mohamed-youssef-bou
mohamed-youssef-bou marked this pull request as ready for review November 10, 2026 21:35
@mohamed-youssef-bou

Copy link
Copy Markdown
Contributor Author

Ready for review at d1e3f1490. The red Sensitive Change Review on the previous head came from the split touching security_posture.py; this head leaves that file alone.

@bolichen97, could you approve the fork runs here and on #34667, and review both when they're green?

AI-assisted, sent by Kiro Crew

mohamed-youssef-bou added a commit to mohamed-youssef-bou/KiroCrew that referenced this pull request Nov 11, 2026
Bolin Chen accepted the chat_rename tool as designed in an approving
review of kirodotdev#33633. Record it in the RFC's Sign-off section and its index
row, and move the status to in-progress, since kirodotdev#33736 implements it.
Whether a conductor may reach the tool behind its approval prompt stays
open for the owner: the review leaves it out.
mohamed-youssef-bou added a commit to mohamed-youssef-bou/KiroCrew that referenced this pull request Nov 11, 2026
Bolin Chen accepted the chat_rename tool as designed in an approving
review of kirodotdev#33633. Record it in the RFC's Sign-off section and its index
row, and move the status to in-progress, since kirodotdev#33736 implements it.
Whether a conductor may reach the tool behind its approval prompt stays
open for the owner: the review leaves it out.
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 11, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 11, 2026
@KiroCrewCaptain

KiroCrewCaptain commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 2112 lines, more than the 400 it may approve on its own.

Adds a chat_rename directive on kirocrew-core that renames only the calling session, built like chat_tag. Sweeps found no defect. Every reader of title_origin handles the new agent value: restoring after a reload keeps it, older versions read it as final user, background refresh only touches auto, forks turn it into user, name_member_thread and mrkdwn_title keep it, and the other writers set user, which replaces it. The replaceable-origin rule is an allowlist (auto, member, agent), so a title with no recorded origin is protected. The existing person-only gate refuses slot-less and unmarked turns; the applier also requires a person's actor, _turn_user_sent and no channel flags, refuses channel tabs, Crew Mode chats and crewmate conductor chats (an unreadable record is refused too), and re-checks the slot after the worker-thread reads with no await before the write. Moving five functions out of chat_title.py keeps import paths and test patches working through _facade_compose. New keywords default to today's behaviour. Test coverage is extensive. The open conductor sign-off is handled by refusing conductors for now, which matches the accepted RFC. CI ha

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit d281d6191b · 2112 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 11, 2026
@mohamed-youssef-bou

Copy link
Copy Markdown
Contributor Author
  • product-shape change without accepted RFC: always-on self-rename on the default agent span=f61868d86dd5

Acknowledged: the decision is made but is not on main yet. @bolichen97 accepted the tool as designed in review 5846058182 on #33633 (Sign-off item 1), which covers an always-on, auto-approved chat_rename on kirocrew-core.
#34667 records that acceptance as status: in-progress. Once it merges, this branch is rebased onto main and the lane reads the new status.

@bolichen97, could you approve and merge #34667 once its CI finishes? I'll push the rebase here right after. That push also adds the reader list PR Hygiene asks for, and re-runs Security Scope Review, whose job failed to connect to github.com.

AI-assisted, sent by Kiro Crew

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 11, 2026
bolichen97 pushed a commit that referenced this pull request Nov 12, 2026
Bolin Chen accepted the chat_rename tool as designed in an approving
review of #33633. Record it in the RFC's Sign-off section and its index
row, and move the status to in-progress, since #33736 implements it.
Whether a conductor may reach the tool behind its approval prompt stays
open for the owner: the review leaves it out.
@mohamed-youssef-bou

Copy link
Copy Markdown
Contributor Author

Rebased onto main with #34667 merged, so the RFC is in-progress on this head's base and First Principles can read the recorded decision. This head also carries the reader list PR Hygiene asked for, and its push re-runs Security Scope Review.

@bolichen97, thanks for merging #34667. Could you approve the runs for this head?

AI-assisted, sent by Kiro Crew

@mohamed-youssef-bou

Copy link
Copy Markdown
Contributor Author

@bolichen97, thanks for approving the runs. On this head the review lanes pass (Design, First Principles, Opus, GPT and Security Scope), and so does PR Hygiene; four backend test shards are still running. main has moved since, so I checked the merge onto today's main (097a01bae): it has no conflicts, and docs-lint passes on the result. Once the shards are green, this needs a code-owner approval and a merge.

AI-assisted, sent by Kiro Crew

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 12, 2026
@mohamed-youssef-bou

Copy link
Copy Markdown
Contributor Author

The two red tests on the previous head were main's, not this PR's. test_wait_discipline_ratchet.py::test_the_scan_matches_known_sites and test_updates_handlers_facade.py::test_every_name_served_from_outside_the_family_is_visible_to_type_checkers failed the same way in main's own CI at c6b537e49 and ce89396c9, and #35625 fixed both. This head is rebased onto that fix, and both files pass on it locally, so its runs need a maintainer's approval once more.

AI-assisted, sent by Kiro Crew

@mohamed-youssef-bou

Copy link
Copy Markdown
Contributor Author

Rebased onto today's main (9ff856f16). Since the previous head, main added two tools to the registries this PR also edits: mcp_server_wait (#35722) and session_queue (#15423), in the schema registries, the tool titles and the tool-set pins, plus mcp_server_wait in control.py. The rebase is clean, and this PR's suites pass on it. Nobody had approved the previous head's runs, so this still needs only one approval.

@bolichen97, could you approve the runs for this head when you get a chance?

AI-assisted, sent by Kiro Crew

chat_title.py sits one line under the 2,000-line cap, so the next change
to it cannot land. The explicit-title paths (the rename route and
apply_manual_title, and "Regenerate title" with generate_manual_title
and apply_regenerated_title) move to chat_title_explicit.py, unchanged
but for one comment's wording, and _facade_compose runs them on
chat_title's globals. chat_title stays their import path and patch
target, so no caller or test changes; a composition test pins that.
name_member_thread stays in chat_title with its redaction, so the
security posture's module list is unchanged.
An agent on the default spec cannot rename the session it runs in:
session_rename lives in the opt-in kirocrew-dashboard server, which
the default spec does not mount, and it needs a target the agent
cannot learn. chat_rename is a kirocrew-core session directive,
shaped like chat_tag, that renames only the calling session, under
session_rename's title rules and refusals.

Only a turn the person sent may rename. Beyond the user-origin gate,
it requires a person's turn actor, a turn the dashboard still counts
as user-sent, and no channel provenance, so a script cron's
send_to_session turn and a turn another session, an app or a channel
steered into are refused. A channel's own tab is refused whether or
not it is bound yet, and so is a conductor's session (Crew Mode or a
crewmate's own chat) until the owner decides whether conductors may
rename themselves.

It never replaces a title someone set by hand. The title it writes
carries a new origin, "agent", which the background titler treats as
final and Slack listings read as typed text; a person's later rename
replaces it, and "Regenerate title" hands the name back. Each applied
rename writes the chat.manual_rename audit row every rename writes.
Incognito and temporary sessions can rename themselves too.

Implements docs/request-for-change/rfc-agent-self-rename.md.
@mohamed-youssef-bou

mohamed-youssef-bou commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

@bolichen97, rebased onto today's main (29440e5c6) and pushed 54ea1a89d. Two things on main needed changes here:

  • The 2026-11-13 decision naming the feature conductor mode: the tool's description, its reply and its refusal now say "a conductor mode chat or a Bot's own chat" instead of "a conductor's session" and "Crew Mode". The conductor_session code is unchanged.
  • feat(security): one redaction switch, rule table only, value-only masks #37408 (redaction off by default): the synthetic credential in the redaction test is now github_classic(seed=85), as in test_session_control_rename.py, and a new test pins that a title is kept as written inside the chat turn while the owner has redaction off. The tool text and the RFC now say redaction applies while it is on.

The local gates pass on this head. Its runs need a maintainer's approval, then a review.

AI-assisted, sent by Kiro Crew

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving at 54ea1a89d1. I did one deep pass over the tool, the applier and the title-origin change, and checked them against the accepted RFC (#33633, Sign-off item 1).

What I checked

  • Self-only. chat_rename carries no target. The dispatcher applies it to the slot that produced the turn, and _apply_chat_rename re-checks that the slot is still live (state._slots.get(slot.key) is slot, not closing) before the probe and again after it, with no await between the second check and the write. Another session, an app or a cron cannot reach a person's session through it.
  • Person's turn only. The tool is in USER_SURFACE_DIRECTIVES, and the applier also requires an actor in _PERSON_ACTORS, _turn_user_sent is True, and neither channel flag. I checked that every slot attribute it reads through getattr is a real field on _ChatSlot (_turn_user_sent, _turn_channel_origin, _turn_channel_narrowed, channel_origin, the is_closing property), so no check falls back to a silent default.
  • A person's title is never replaced. _AGENT_REPLACEABLE_ORIGINS is an allowlist (auto, member, agent), so a titled slot with no recorded origin is refused as manual_title. Every reader of _title_origin treats agent as final (the refresh paths compare against auto, name_member_thread keeps it, the fork maps it to user), and an older build reads it as user.
  • Input. The title goes through the existing _clean_rename_title (1 to 200 chars after stripping, no control, bidi or hidden characters, redaction). The schema bound matches SESSION_RENAME_SCHEMA. The audit line logs only the length or the refusal code, never the title.
  • Conductors are refused (conductor_session) until Sign-off item 2 is decided, and an unreadable execution record fails closed. allow_ephemeral waives only the memory-mode refusal.
  • Live update. The write goes through apply_manual_title, which already broadcasts to the sidebar, so the frontend needs no change.
  • Split. The moved helpers keep their behaviour. The only change in the second commit is the origin keyword, which is guarded with a ValueError for any value other than user or agent.

Ran locally on this head

  • The 8 test files this PR adds or changes: 485 passed.
  • Neighbouring rename, title and slot-ownership suites (test_session_control_rename.py, test_dashboard_chat_session_meta.py, test_slot_ownership_checkpoint.py, test_file_line_cap.py, -k "rename or title or line_cap or family"): 231 passed.
  • flake8 and mypy on the 16 changed source files: clean. The file-line cap, comment-history and brand gates: pass.

Non-blocking notes

  • RFC Sign-off item 2 (whether a conductor may reach chat_rename) is still open. A team member has to make that design call. This PR is safe without it because it refuses conductors.
  • chat_title.py is at 1,818 lines, past the 1,600-line working target. This PR shrinks it, so this is only a heads-up for the next change there.

AI-assisted, sent by Bolin Review bot

@bolichen97
bolichen97 enabled auto-merge (squash) November 16, 2026 17:50
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 16, 2026
@bolichen97
bolichen97 merged commit 770339d into kirodotdev:main Nov 16, 2026
94 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 16, 2026
@mohamed-youssef-bou
mohamed-youssef-bou deleted the feat/agent-self-rename branch November 16, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let the default agent rename its own session (core, self-only chat_rename)

3 participants