Skip to content

feat(mcp): session_generate_title regenerates a created session's title - #15468

Closed
Pearcekieser wants to merge 1 commit into
kirodotdev:mainfrom
Pearcekieser:feat/mcp-session-generate-title
Closed

Pearcekieser wants to merge 1 commit into
kirodotdev:mainfrom
Pearcekieser:feat/mcp-session-generate-title

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An agent on the kirocrew-dashboard MCP server can ask for a fresh sidebar title on a session it created, the same way a person clicks "Regenerate title".

A conductor names each worker once, at session_create. When a worker's task drifts, that title goes stale, and today only a person can regenerate it from the sidebar menu (POST /api/chat/slots/{slot}/generate-title). That route has no caller-ownership fence and no rate limit, so it cannot simply be exposed as a tool.

Why it matters

A person scanning a sidebar full of worker sessions finds the one they need by its title. A conductor running a dozen workers leaves a dozen titles that describe the first task, and the person regenerates them one by one. Handing this to the agent needs a bound on reach (only its own workers) and on spend (each call is a model call).

Not a goal

What changed (motivation → approach → change)

The sidebar route's body moves into regenerate_title(state, slot) in dashboard/chat_title.py, and the route now calls it, so the tool and the menu item share one code path and one set of race guards. It makes one background one-liner call on the titling model and waits for it, so the tool can return the new title in the same call. Like the menu item, the result replaces a hand-set title and stays an auto title; a rename that lands during the model call still wins. If the session is closed during the call, possibly with a new one opened under the same key, the title is discarded instead of being written into the successor or into the closed session's archived line; the sidebar route shares that guard. To make the discard hold against a close that starts during the history write, regenerate_title writes the title to history first (a new title_fields argument on _persist_title) and sets it on the slot only afterwards, once the slot is still live and not closing. A close saves the slot's title under the transcript lock, so it records the previous title, and the write guard refuses once a close has begun. A close that begins after the write committed gets the slot's previous title written back, so a close that aborts leaves the history line matching the live session. After the slot shows the title, its own values are written once more, so an ordinary save that took the lock between the commit and the publish cannot leave the previous title on disk.

session_generate_title(target) (mcp_dashboard.py, schema in validation.py) posts to a new strict-internal route, POST /api/session-control/generate-title (dashboard/server.py, handler in dashboard/handlers/session_control.py), which calls generate_title_target in dashboard/session_control.py. That runs authorize_target like session_stop, and then refuses any target the caller did not create (not_creator, 403) for every caller class, because the verb spends a call to relabel a session. It then admits one call per target every 300 seconds through the existing creation limiter (dashboard/create_rate_limit.py, a new budget-1 generate_title verb keyed by the target slot), stamped before the model call, so a patrol loop or a concurrent retry cannot spend twice (title_rate_limited, 429). A refused call spends nothing and does not start the window. After the model answers, authorize_target runs again synchronously before anything is written (passed in as a still_allowed callback), so a target that became channel-linked or mirrored during the call is not retitled; a target closed, closing or replaced mid-call is reported as target_replaced (409) and keeps its previous title. The history write itself carries a still_current guard checked under the transcript lock on the write's worker thread: the slot is still the live one and not closing, and still_allowed passes again, so a target linked or mirrored while the write waited for the lock gets no durable title, and the sidebar push is skipped when the slot was closed or replaced during the write. If the write fails, regenerate_title reports saved=False and the verb answers title_persist_failed (500); the live slot keeps the title, as the sidebar rename does. Every admitted call and every refusal after the gate is SEL-audited. The MCP call waits up to 120 seconds for the route.

The tool is withheld from unattended conductors (agent.py), blocked for channel agents (channel.py), titled in data/mcp_tool_titles.json, and listed in docs/session-control.md, docs/index.md, the feature map and the architecture page.

Backwards compatibility

Compatible: adds one tool and one route. The sidebar route keeps its request, response and behaviour; its body moved into a function it now calls.

Tests

test/test_session_control_generate_title.py covers: a created session is retitled and the reply carries the title; an unchanged result reports the current title; a session the caller did not create, one another session created, the caller itself and a channel-linked target are refused before any model call; a repeat inside the window is refused with 429 and spends nothing; the window expires; a refused call does not start the window; two concurrent calls spend one; a hand-set title is replaced and becomes auto, as in the sidebar. A session replaced under the same key, or linked to a channel, during the call gets neither the persist nor the sidebar push; one replaced during the history write is refused by the write guard and not pushed; a close that begins during the history write finds the slot still showing its previous title, the write guard refuses, and the call answers target_replaced; a close begun during the model call gets no write; _persist_title(title_fields=...) writes the pending title without touching the slot; a failed write answers title_persist_failed; a target linked to a channel while the write waits for the lock is refused inside the write guard; a close begun after the commit gets the previous title written back; a save landing between the commit and the publish is overwritten by the post-publish write. Route tests cover the internal-secret refusal, the result, the 429 mapping and strict-internal membership. MCP tests cover the verified key, the 120-second timeout and the three replies. The registration, advertised-set, doc-count and carried-fence tests list the new tool and route.

Manual verification

N/A: the new path is a gate in front of an existing route body, and both are exercised by unit tests against a real DashboardState; there is no UI change.

Related Issues

Fixes #15452

Refs #10149, #15162

Follow-up: #15559 (the same same-key replacement race in the background maybe_refresh_title, left as-is here)

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

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Intent: Let an agent on the kirocrew-dashboard MCP server regenerate the sidebar title of a session it created, through the same code as the sidebar's "Regenerate title" action, with reach limited to its own sessions and one call per session every 120 seconds.
Not a goal: setting an exact title (session_rename), retitling the caller itself or a session a person opened, or changing the sidebar action, its prompt, or the background refresh.

@Pearcekieser
Pearcekieser marked this pull request as ready for review September 30, 2026 16:15
@Pearcekieser
Pearcekieser requested a review from a team as a code owner September 30, 2026 16:15
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 30, 2026
@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-generate-title branch from 64477b0 to b878339 Compare September 30, 2026 16:30
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of 0379f2698417f00de760938126787008541cd1c2 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

Write-first persist choreography — a restore write plus a second persist on every success — buys byte-consistency of an archived title line; the identity guard alone stops the real bleed.

Not justified as shipped

  • Item 7 — oversized: "writes the title to history first … After the slot shows the title, its own values are written once more" closes sub-second windows whose only harm is a closed session's archive briefly disagreeing with a discard report; the successor-bleed and channel-link harms are already stopped by the still_current/still_allowed guard in either ordering, and the post-publish persist doubles the flock'd history write on every successful call (base _persist_title has 9 call sites, all single-write). It also reorders the sidebar path, which ## Not a goal excludes ("Changing what the sidebar action does").
    Subtraction: keep the sidebar's apply-then-persist order and the still_current guard; delete title_fields on _persist_title (1 consumer: regenerate_title), the close-abort restore write, and the post-publish second persist.
    Clears when: the write-first machinery is removed, or a human amends the Goal/Not-a-goal to cover the sidebar's new race behaviour.

What this change ships

Inventory (9 items) — 7 justified

Intent: let an agent retitle worker sessions it created, as the sidebar's "Regenerate title" does, bounded in reach and spend — ADDITION (Fixes #15452).

  1. New session_generate_title MCP tool retitles a session the caller created — justified
  2. New strict-internal route POST /api/session-control/generate-title — justified
  3. Creator-only fence for every caller class (not_creator, 403) — justified
  4. One titling call per target per 5 minutes via the existing creation limiter (title_rate_limited, 429) — justified
  5. Tool withheld from unattended conductors and blocked for channel agents — justified
  6. Sidebar "Regenerate title" now discards the title when the session closes or is replaced mid-call — rides along: declared ("the sidebar route shares that guard"), carried by the shared code path
  7. Title written to history before the slot shows it, with a restore write and a second persist after publish — oversized (entry above)
  8. New target_replaced (409) and title_persist_failed (500) replies — justified
  9. Docs, feature map and tool-title updates in the same commit — justified

The same same-key race in background maybe_refresh_title is the 1 counted unfixed sibling, declared and deferred to #15559 — accepted.

[FIRST-PRINCIPLES-REVIEWED] 0379f26

Description read

[DESCRIPTION-READ] 9f08c6c0510675810828b99e4a302133016063803ea9ece10300454b0338f31a

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of 0379f2698417f00de760938126787008541cd1c2 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 0379f26

Description read

[DESCRIPTION-READ] 49e3858378cae9701612177346c27608a3c927c7e65b82b921f696eb080e2b7d

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — 🔴 changes requested (blocking)

Reviewed 0379f2698417f00de760938126787008541cd1c2 via the fork AI-review pipeline; updated in place on each push.

1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

BLOCKING -- src/kiro_crew/dashboard/chat_title.py:1546 -- authorization can expire before title publication
slot.title = title
Mirror/link added after _commit_guard -> no post-persist access check -> title is persisted and applied to a now-forbidden target.
Anchor: backend-security-controls
Fix: Re-run still_allowed() after persistence and immediately before publication; on refusal, restore the prior persisted title.
[BLOCK-MERGE] 0379f26
[GPT-REVIEWED] 0379f26

Adjudication (Opus 5) — is blocking on each finding proportionate?

The adjudicable block is empty; one fenced finding. Record for F1:

F1 — harm rung: UNBOUNDED (containment-boundary bypass). The window is real and not extreme. Conditions confirmed: caller must be the target's creator (_created_by_other → not_creator, in the added generate_title_target) and spend the one-per-300s budget; still_allowed() is last evaluated inside _commit_guard (new chat_title.py:1501), which runs on the write's worker thread before the metadata commit, so the await asyncio.to_thread join at new chat_title.py:1506 suspends across a real flock-plus-disk write with the loop free; the synchronous span at new chat_title.py:1529/:1538 re-checks only slot identity, is_closing and the title epoch — never the access gate — before slot.title = title and state.push_slot_title at new chat_title.py:1546.

Plausibility, not rarity: _has_channel_mirror's own docstring (src/kiro_crew/dashboard/session_control.py:902-906) states a dashboard-born slot with an empty linked_session_key can be given an OUTBOUND mirror link at any time, since that link lives in the session store rather than on the slot; chat_handlers.py:13820 sets linked_session_key on a live slot. The module already names this exact race as one to engineer against — session_control.py:4434-4439 places the SEL prewarm above the gate precisely because "a user action landing in that window (linking the target to a channel) makes the decision stale and the mirrored_target refusal is bypassed", and concludes "Nothing may suspend between this gate and the act it authorizes."

Recovery path: none. Once the guard admits, the commit stands, the slot is retitled and pushed, and the if saved: re-persist (new chat_title.py:1552-1558) writes the slot's own values back, cementing it; the verb then returns ok with the new title. The title staying origin-"auto" lets the background titler revise it later, but that is not a corrective path for the bypassed containment.

I cannot complete the rarity argument FLAG requires — the triggering operation is an ordinary live one, and the finding's claim aligns with the module's own stated invariant rather than contradicting it. Flagging would hand a hurried reviewer an argument against that invariant.

[ADJUDICATION] 0379f26 total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] 0379f26

[ADJUDICATION-FENCED] 0379f26 fenced=1 flagged=0
UPHOLD-FENCED F1 src/kiro_crew/dashboard/chat_title.py:1546 -- still_allowed() is last evaluated inside _commit_guard before the commit, and the to_thread join suspends across a real flock-plus-disk write while the post-await span re-checks only slot identity, is_closing and title epoch, so an outbound mirror link — which session_control.py:902-906 says can be added to a live dashboard-born slot at any time, and whose gate→act race session_control.py:4434-4439 already declares must never be crossed by a suspension — lands a durable, published title on a now-forbidden target with no recovery path.
[GPT-ADJUDICATED-FENCED] 0379f26

@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-generate-title branch from b878339 to db83f86 Compare September 30, 2026 17:15
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

mechanism: synchronous authorize_target re-run between the model await and the title write

  • issue (blocking, security): authorization becomes stale during title generation

Fixed in db83f86. generate_title_target passes a still_allowed callback into chat_title.regenerate_title, which calls it after the model answers and before it assigns, persists or pushes the title, with no suspension in between. The callback re-runs authorize_target(..., skip_enabled_check=True, precomputed_ownership_fenced=True), so a target that became channel-linked or mirrored during the call is refused with that code and nothing is written. A slot closed and replaced under the same key is dropped by regenerate_title itself and reported as target_replaced. test_a_target_linked_to_a_channel_during_the_call_is_not_retitled links the target inside the mocked model call and asserts no persist, no title change and the linked_session_target refusal; it fails on b878339.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • issue: undeclared re-run claimed in the description

Fixed by shipping the claim in db83f86. The description was updated ahead of the push that carries the change; the still_allowed re-run of authorize_target in dashboard/session_control.py / dashboard/chat_title.py and its test test_a_target_linked_to_a_channel_during_the_call_is_not_retitled are now in the diff, so the description and the code agree.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review (fork) — ✅ no blocking findings

Reviewed 131cf50480d974f6d000236fe1792609b254c3ea via the fork AI-review pipeline; updated in place on each push.

Review details

Advisory only: the new write-before-publish order opens a lost-title-write window against an ordinary slot save.

FINDING — src/kiro_crew/dashboard/chat_title.py:1486 — saved = await _persist_title(..., title_fields=pending) commits the new title while slot.title still holds the OLD one, and the slot is only updated after the await returns; a _save_slot_to_history flush for the same slot that is queued on the transcript flock builds meta_line["title"] = slot.title (chat_persistence.py:4969) / fields["title"] = slot.title (chat_persistence.py:4481) under that lock on the flush thread and so lands the previous title last, after which the verb still answers saved=True / "changed": true and session_generate_title replies Retitled ... for a title the history line no longer carries (a restart before the slot's next save shows the old title) — the epoch loop does not catch it because an ordinary save bumps no _title_epoch → Fix: publish title/_title_origin/_title_low_signal onto the slot from inside the committed-under-lock step _persist_title already has (after_commit_under_lock), so no window exists where the live slot's title disagrees with the title just committed.

[OPUS-REVIEWED] 131cf50

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 30, 2026
@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-generate-title branch from db83f86 to 7a808fd Compare September 30, 2026 18:02
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #15166 (session_end_wait) merged. The conflicts were only in the doc tool lists and counts (now 25 tools, 15 session-control verbs); no code change. The related tests pass on the new head.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 30, 2026
@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 Sep 30, 2026
@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-generate-title branch from 7a808fd to 1d6cca7 Compare September 30, 2026 20:32
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

mechanism: identity guard inside the locked history write, plus an identity re-check before the sidebar push

  • issue (blocking): Same-key replacement can inherit a stale generated title

Fixed in 1d6cca7. regenerate_title now passes still_current=lambda: state._slots.get(name) is slot to _persist_title, which checks it inside the update_metadata_if guard under the transcript lock, so a session closed and recreated under the same key during the write refuses the commit. After the write it checks slot identity again and skips push_slot_title when the slot was replaced; the verb reports target_replaced. Tests: test_a_session_replaced_during_the_write_is_not_published (the replacement lands inside the persist, guard answers False, no push) and test_the_write_guard_refuses_the_commit (a False guard leaves the line unwritten).

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

mechanism: regenerate_title returns RegeneratedTitle(title, saved); the verb raises title_persist_failed on saved=False

  • issue (blocking): Failed persistence is reported as a successful retitle

Fixed in 1d6cca7. regenerate_title returns RegeneratedTitle(title, saved) with the _persist_title result, and generate_title_target answers title_persist_failed (500), audited as an error, instead of ok when saved is False. The live slot keeps and shows the title (the next full save writes it), the same best-effort shape as the sidebar rename; the sidebar route keeps its response. Test: test_a_failed_history_write_is_reported_not_claimed_as_success.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • suggestion: duplicate window limiter

Accepted, deletion made in 1d6cca7. GENERATE_TITLE_COOLDOWN_SECS, _generate_title_started and the hand-rolled window are gone; _admit_generate_title now calls create_rate_limit.allow_create with a new budget-1 GENERATE_TITLE verb keyed by the target slot. The window is the shared 300 s, and the docs and tool description say 5 minutes.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • note: the same race remains in maybe_refresh_title

Recorded as #15559 and linked from the PR description. The background refresh is outside this PR's goal; the issue names the same two guards (still_current on the write, identity check before the push) for that path.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • issue (non-blocking): target_replaced claims nothing changed when the write may have committed

Fixed in 1d6cca7. regenerate_title now re-checks slot identity after await _persist_title and skips the sidebar push when the slot was replaced, and the write itself carries a still_current guard checked under the transcript lock, so a close that lands before the commit refuses the write. For a close that lands after the commit, the refusal no longer says "nothing was changed": it says the new title was not shown in the sidebar and may not have been saved, and docs/session-control.md says the same.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • issue (non-blocking): MCP timeout equal to the cooldown admits a concurrent retry

Fixed in 1d6cca7. The per-target window is now the shared create_rate_limit.WINDOW_SECS (300 s), which is longer than the tool's 120 s wait. The comment and docs/session-control.md now state that bound (a retry is refused for 5 minutes from admission) instead of "until the first call is done", since the titling one-liner itself has no timeout.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 1, 2026
Adds session_generate_title to kirocrew-dashboard over a strict-internal
POST /api/session-control/generate-title. It runs the sidebar's Regenerate
title code (factored into chat_title.regenerate_title), reaches only sessions
the caller created, and admits one call per target every 120 seconds.
@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-generate-title branch from 131cf50 to 0379f26 Compare October 2, 2026 07:15
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

mechanism: access re-check inside the locked write guard, a restore write when a close begins after the commit, and a post-publish write; regression tests test_a_mirror_link_added_during_the_write_refuses_the_commit, test_a_close_begun_after_the_commit_restores_the_previous_title, test_a_save_landing_between_commit_and_publish_is_overwritten

  • issue (blocking, security): authorization can change during persistence (chat_title.py:1489)

Fixed in 0379f2698417. The write guard passed to _persist_title now runs still_allowed as well as the liveness check, inside the transcript lock on the write's worker thread, right before the commit. A target that became channel-linked or mirrored while the write waited for the lock is refused there, nothing is written, and the call answers with the gate's own refusal (linked_session_target or mirrored_target). authorize_target is safe off the loop on this path: it reads the same state _has_channel_mirror already reads from asyncio.to_thread elsewhere in session_control.py, and the switch read and fence are skipped as before. I did not add a second re-check after the commit: once the guard passed under the lock the commit is the decision point, and refusing afterwards would leave the title on disk but not on the slot.

  • issue (blocking): failed persistence is still published (chat_title.py:1513)

Kept, as the adjudicator downgraded it (disproportionate remedy). saved=False now means only a failed history write, because a guard refusal returns before publishing. That case keeps the title on the live slot and answers title_persist_failed (500), whose message states that the next save writes it, the same contract the sidebar rename has.

  • issue (blocking): an aborted close leaves inconsistent durable state (chat_title.py:1502)

Fixed in 0379f2698417. When the write committed and a close began before the call resumed, regenerate_title now writes the slot's own (previous) values back before discarding, guarded on the slot still owning its key so a successor that may share the history line gets nothing. Whether that close completes or aborts, the history line matches what the live session shows.

@Pearcekieser

Pearcekieser commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto main after session_reload (#15499), no behaviour change from the rebase. The conflict was in the shared tool lists, routes and docs; both tools are kept. Head 0379f26 also carries the round-6 fixes answered in the GPT (span 01dd9f0739bd) and Opus (span 36e0c2619fee) disposition comments on this PR.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

mechanism: post-publish write of the slot's own values; regression test test_a_save_landing_between_commit_and_publish_is_overwritten

  • suggestion (non-blocking): a save between commit and publish can land the previous title last (chat_title.py:1486)

Fixed in 0379f2698417. After the slot shows the new title, regenerate_title writes the slot's own values once more, guarded on the slot still being live and not closing. A save that took the lock between our commit and the publish wrote the previous title; the follow-up write replaces it, and from that point every save reads the new title from the slot. I chose this over publishing from after_commit_under_lock because that callback runs on the write's worker thread, and the slot's title fields and the sidebar push belong on the loop. A close that begins after the publish saves the new title itself, so the handler now reports target_replaced only for a discarded title.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 2, 2026
@dodgeblaster dodgeblaster added the needs-pr-triage PR scanner: awaiting automated triage label Oct 5, 2026
@dwu96 dwu96 added drive-to-green PR claimed by drive-to-green pipeline and removed needs-pr-triage PR scanner: awaiting automated triage labels Oct 5, 2026
@dwu96

dwu96 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: dwu96#8c08bee0]: This PR has been inactive for 7+ days with failing CI. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author.

Assessment: three blockers, all with a determined remedy.

  1. GPT 5.6 fenced finding F1 at chat_title.py:1546 — authorization can expire before title publication. still_allowed() is last evaluated inside _commit_guard, which runs on the write's worker thread before the metadata commit; the await asyncio.to_thread join then suspends across a real flock-plus-disk write, and the synchronous span re-checks only slot identity, is_closing and the title epoch before slot.title = title / state.push_slot_title. The remedy the lane names is local and already has in-tree precedent: re-run still_allowed() after persistence and immediately before publication, restoring the prior persisted title on refusal. session_control.py:4434-4439 places the SEL prewarm above the gate for exactly this reason and states the invariant — "Nothing may suspend between this gate and the act it authorizes." The fix tightens the gate, so it is a missing-guard repair rather than a policy change, and your 0379f26984 disposition already describes the access re-check. I will not restructure the commit path.
  2. Backend Tests (Windows) (5) — one failure out of 20,419 passed: test/test_crew_log_retention.py::test_a_destroyed_sessions_log_is_then_collectable_by_the_sweep, assert store.sweep_expired(30) == (1, 0) returning (0, 1). This PR touches no crew-log or retention code (its backend surface is chat_title.py, create_rate_limit.py, session_control.py, validation.py), so it is base drift or a sweep-timing flake; a rebase re-tests it on a fresh base.
  3. Opus 5 Review — "review incomplete" — an operational outcome, not a verdict. A new head re-runs the lane.

Plus the merge conflict, which your own notes record as tool lists, routes and doc counts shared with session_reload — take-both plus a count bump.

If you'd prefer I don't touch this PR, add the pr-no-autofix label.

Copy link
Copy Markdown
Contributor

Automated rebase attempt onto main (cc7e79894e): aborted, nothing pushed. The branch is still at 0379f26984.

The single commit conflicts in 6 files. I didn't resolve them automatically because main has restructured the code this PR edits:

  • src/kiro_crew/mcp_dashboard.py: refactor(mcp): build kirocrew-dashboard on one tool table and a port #17098 rebuilt kirocrew-dashboard on one Tool(...) table (name/run/identity/routes) driven by MCP_DASHBOARD_SCHEMAS. The per-schema imports, the dict-style tool entry and the SESSION_CONTROL_TOOLS tuple this PR adds no longer fit. session_generate_title has to be re-expressed as a table entry, and its identity/channel-containment gating has to be redone through the table.
  • src/kiro_crew/dashboard/server.py: the hunk sits on the app-window helpers main replaced (_APP_WINDOWS_SUBDIR). Since refactor(dashboard): compose server.py from server_runtime owners #16997, MCP routes are registered in server_runtime/mcp_routes.py, so the session-control/generate-title route belongs there.
  • src/kiro_crew/dashboard/chat_title.py: main added its own app-request identity guard to regenerate_title and _persist_title: still_current=lambda: state._slots.get(name) is slot for request["app"], plus a slot_not_found() return. This PR rewrites the same path as write-first/show-second with _commit_guard + title_fields and returns RegeneratedTitle. Merging the two is a design call (whether the app branch keeps its HTTP 404 or folds into the commit guard), not a mechanical one. The typing.Callable vs collections.abc.Callable import also conflicts.
  • docs/architecture/mcp.md, docs/feature-map/README.md, src/kiro_crew/docs/index.md: the tool lists and rows changed on main (chat_folder_delete, work_ledger_rebuild, the Members work-log text, the crew-log row). These are easy, but they depend on the code above.

@dwu96 has already said they will push fixes to this branch, so the author or co-author should rebase this by hand along with those fixes.

@buluoray

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: Taking this over in #19603 since it has been idle; you are credited as co-author on the commits. Thanks for the groundwork.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thanks for this, @Pearcekieser. session_generate_title has since landed on main via #19603 (commit 9d9b67e), which also closed the linked issue #15452, so this PR is now superseded. Closing it for that reason. If we missed something this PR covers that #19603 does not, please reopen and let us know.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 19, 2026
@mbriones98 mbriones98 removed the drive-to-green PR claimed by drive-to-green pipeline label Oct 19, 2026
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) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): session_generate_title regenerates a created session's title

7 participants