feat: add tag_session MCP tool for agent-driven session tagging - #3469
feat: add tag_session MCP tool for agent-driven session tagging#3469fanhongy wants to merge 1 commit into
Conversation
6f0437a to
a18ff62
Compare
32ef17d to
b9e45ad
Compare
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed BLOCKING -- src/kiro_crew/mcp_tools/sessions.py:471 -- Explicit slot keys bypass caller-session authorization BLOCKING -- src/kiro_crew/mcp_tools/sessions.py:550 -- Stale updates can regress or erase concurrent tag changes |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSAdvisory premise-level review of I've reviewed the contract, the intent file, the patch, and the relevant base code ( First-Principles-Verdict: CONCERNS The tool earns its place; the advancement-only/ What this change shipsIntent: let an agent move its own session between kanban columns instead of the user dragging it — an ADDITION.
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] 11c0e6a |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsBased on my falsification pass:
None survive falsification at 80+. No findings. [OPUS-REVIEWED] 11c0e6a |
Design Review (Fable 5, fork) — 🟡 CONCERNSAdvisory design-level review of Based on my review of the patch, the base code it integrates with ( Key facts I verified:
Design-Verdict: CONCERNS The advancement-only guard is built on the tag Watch
Suggestions
[DESIGN-REVIEWED] 11c0e6a |
…ging Adds a new `tag_session` tool to the kirocrew-core MCP server that lets agents assign status/label tags to dashboard session slots, moving them between kanban board columns programmatically. Features: - Case-insensitive tag name resolution - Status tags advance forward only (planned->todo->implementation->review->done) with optional force override for regression - Non-status tags can be added alongside status tags - Defaults to tagging the agent's own session; accepts explicit slot_key - SEL audit logging Resolves kirodotdev#3456
b9e45ad to
11c0e6a
Compare
Review dispositions —
|
GPT 5.6 — disposition for
|
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
2 similar comments
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
|
🤖 Kiro Crew [operator: iamwhatever]: This PR has been inactive since 2026-08-15. I reviewed the blockers, but they hinge on a decision only a maintainer can make rather than a mechanical fix: The only blocking gate is GPT 5.6 Review (2 BLOCKING findings). Every other check passes — Opus 4.8 cleared the identical code with no blocking findings, and Design Review / First Principles are advisory
Both of GPT's requested fixes would change this PR's design direction or expand its scope, which the automated pipeline won't do. A maintainer needs to either uphold your rebuttals (and override the GPT gate) or ask you to make one of the design changes above. When that direction is set, the pipeline will re-assess on its next cycle. |
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
1 similar comment
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
Closing — the same capability as #7779, which is the governed implementationVerified relationship: Both PRs are open (pr/3469 = 11c0e6a, pr/7779 = 194897b) and origin/main 1a765b8 has neither surface: sessions.py HANDLERS still holds exactly three read tools, DIRECTIVE_TOOLS has no chat_tag, and the only 'tag_session' token on main is prose in api_chat_tag_delete's docstring. So both add the same previously-absent capability - an agent-callable MCP surface that sets its own dashboard session's mutually-exclusive kanban workflow tag. On the shipped vocabulary they are behaviourally interchangeable: state.py:6291 _DEFAULT_TAGS seeds five status tags whose ids equal their lowercased names, so tag_session(tag='review') and chat_tag(set_state='review') land the same board state through different plumbing. They are not merely co-located: #7779's whole premise is that agent tag writes pass one policy chokepoint (chat_tags.agent_tag_policy, consulted only inside _apply_chat_tag), while #3469 writes over PUT /api/chat/slots/{slot}/tags - the human/UI endpoint, which #7779 leaves untouched and cannot gate without breaking the human drag path. Ship both and an agent refused 'customer' by chat_tag simply calls tag_session(tag='Customer'); the governance #7779 exists to add is defeated by #3469's presence, so only one can land. #7779 is the right survivor: 11 files / 743 adds including the in-lock atomic write reusing tags_write_lock + validate_folder_tag_ids + save_slot_off_loop with the entry-time expected_history_key pin that main itself just hardened (fef7e36, #7714), SEL chat.self_tag, headless-caller refusal, a read surface, 22+ tests, doc updates, and three answered review rounds dated 2026-09-02; #3469 is 3 files / 307 adds doing an unlocked GET/GET/PUT read-modify-write, has been inactive since 2026-08-15, and its two GPT BLOCKING findings (slot_key bypasses caller-session authorization; stale full-list PUT) were rebutted rather than fixed - the bot itself calls it a reviewer standoff awaiting a maintainer. Carry this over firstThis closure is about redundancy, and these items are the exception: they are not on Before closing #3469: (1) carry the still-open #3456 ask for a foreign/named-session target (tag_session's optional slot_key, src/kiro_crew/mcp_tools/sessions.py + FieldSpec('slot_key') in validation.py) onto #7774's v2 scope as a GOVERNED target argument on the chat_tag directive - not as a second HTTP writer; the GPT blocking on #3469 is the design constraint to carry with it. (2) Fix #7779's id-only addressing with #3469's name resolution: in _apply_chat_tag's vocab_by_lower, also index (t.get('name') or '').lower() -> t, and have the unknown_tag refusal enumerate the live vocabulary the way tag_session's "No tag named '{x}' found (case-insensitive). Available: ..." does - otherwise a user-created status tag (uuid id, agent-writable by default policy) is unreachable, and relax _TAG_ID_RE enough to carry a spaced label. (3) Record, on #3456 rather than in code, that its 'advancement-only unless forced' ask has no correct implementation yet: #3469's guard compares tag['order'], a user-reorderable display index assigned len(state._tags) at creation, so it needs a real lifecycle rank first. (4) Note #3469's own #3456 finding that a server-side atomic tag-mutate endpoint is the proper fix - #7779's in-lock applier already discharges it for the agent path. Nothing else in #3469 (mutual exclusivity, non-status add, self-slot resolution, SEL audit, its 10 tests) is uncovered by #7779. Current stateNeither side has merged - the issue/PR reference check lists 3469 and 7779 both as open PRs, both cited issues (#3456, #7774) are open ISSUEs with no code, and the landed-commit index for From a repository-wide duplicate/overlap audit of every pull request open against |
Pull request was closed
Open PR relationship auditThis is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion. Relationship findings
No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit. |
Problem / Motivation
The dashboard has a full kanban board with status tags (Planned, ToDo, Implementation, Review, Done) and sidebar columns, but agents have no way to tag their own sessions. Users must manually drag session cards between columns, which is tedious when running many parallel sessions.
Why it matters
Power users running 10+ concurrent sessions can't keep their kanban board current without hand-curating it. The board goes stale and loses its value as a workflow tracker. An agent that could move its own session between columns as work progresses (implementation → review → done) would keep the board accurate with zero manual effort.
What changed
Adds a
tag_sessionMCP tool to thekirocrew-coreserver that assigns status/label tags to a session slot via the existing dashboard tag API.Motivation → approach → change:
PUT /api/chat/slots/{slot}/tagsendpoint, resolving the caller's own slot by default and enforcing forward-only lifecycle advancement for status tags.TAG_SESSION_SCHEMAinvalidation.py(tag, optionalslot_key, optionalforce).tag_sessionhandler inmcp_tools/sessions.py+ registration inHANDLERS.planned→todo→implementation→review→done);force=trueoverrides. Non-status tags are added alongside existing tags._resolve_session_key_strict()(fail-closed for subagents) with thedashboard:slot-key prefix — matching the sibling session-mutating tools (monitor_start,autonudge_stop).Tests
test/test_mcp_sessions_tag.py— 10 tests covering:force; allowed withforce=truedashboard:prefix)slot_key→ fail-closed errorManual verification
N/A — unit coverage sufficient. The underlying
PUT /api/chat/slots/{slot}/tagsendpoint is already production-proven (the dashboard UI drag-drop uses the same path), and the handler is fully exercised by mocked-API unit tests.Related Issues
Fixes #3456
Checklist
feat: ...)