fix(slack): use generated assistant thread titles - #74385
Open
ghostmfr wants to merge 1 commit into
Open
Conversation
ghostmfr
force-pushed
the
fix/slack-semantic-thread-titles
branch
from
July 29, 2026 21:02
866dd45 to
731273f
Compare
teknium1
reviewed
Jul 30, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for tracing the generated-title path and covering stale-session/workspace cases.
Problems
plugins/platforms/slack/adapter.py:1015adds_claimed_assistant_thread_titlesas an unbounded process-lifetime set. Every successfully authorized DM title permanently retains a workspace/channel/thread tuple. Current main bounds the prior_titled_assistant_threadsguard at 5,000 entries (plugins/platforms/slack/adapter.py:4592-4602); this new guard has no equivalent lifecycle.- The PR is currently dirty against main. The generated-title callback moved into
TurnRunner(gateway/run.py:5298-5354) after the PR base, so the Slack callback needs conflict-aware transplanting into that current chain.
Suggested changes
- Preserve at-most-once behavior with bounded or durable ownership state, and cover the high-thread-count lifecycle.
- Salvage the callback using the current
TurnRunnercontext values (ctx.source,effective_session_id,session_key, andrun_generation).
Automated hermes-sweeper review.
| self._titling_assistant_threads: set = set() | ||
| self._attempted_assistant_thread_titles: set = set() | ||
| # Exact ownership claims are intentionally retained for this process's | ||
| # lifetime. Evicting them would reauthorize an unconditional remote |
Contributor
There was a problem hiding this comment.
_claimed_assistant_thread_titles is intentionally retained for the entire process and has no cap or cleanup path, unlike the existing 5,000-entry _titled_assistant_threads guard. A long-running gateway will retain one tuple for every titled DM thread. Please use bounded or durable ownership state that keeps the at-most-once guarantee, and add a high-thread-count lifecycle test.
Contributor
Author
There was a problem hiding this comment.
The PR is updated to address both points.
- Replayed the change cleanly onto current
mainand integrated it through the existingTurnRunnercontext (ctx.source,effective_session_id,session_key, and the session invalidation generation). - Replaced the unbounded ownership set with bounded, workspace-scoped best-effort state. In-flight reservations are protected from cache-pressure eviction, and ambiguous Slack attempts remain claimed to avoid duplicate calls.
- Added coverage for high-thread-count pressure, concurrent duplicates, /new and /stop invalidation, ordinary later turns, malformed timestamps, workspace isolation, and Agent/Assistant DM provenance.
Would appreciate another look when you have a chance.
ghostmfr
force-pushed
the
fix/slack-semantic-thread-titles
branch
from
July 31, 2026 20:09
731273f to
8895094
Compare
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Slack Agent/Assistant DM threads were titled from the raw first user message even though Hermes already generates a concise semantic session title after an early completed exchange.
This change removes the raw-prompt title mutation and best-effort sends Hermes's generated session title to Slack instead.
Related Issue
No linked issue.
Type of Change
Changes Made
TurnRunnerauto-title callback./new,/stop, stale-run eviction) from ordinary later turns with a small in-memory marker in the existing session state, closing pre-rotation and late-auxiliary-callback races without suppressing the first valid generated title.No persistence ledger, durable schema/database change, session-history lookup, or route metadata is added.
How to Test
assistant_thread_titles: true.Automated verification on current upstream
main:RED-capability checks: applying the original feature tests to the exact clean upstream base produced 20 expected failures. Three later adversarial regressions also failed first—active reservation eviction under cache pressure, reset invalidation before session-ID rotation, and
/stopwith no active agent leaving a pending title authorized—then passed after focused fixes. The complete candidate passed all 193 focused tests.A live macOS Slack Agent/Assistant DM smoke test on the reviewed predecessor candidate also confirmed generated semantic titling and normal response streaming before the change was replayed cleanly onto current upstream
main.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passThe focused candidate suites are green. The broader gateway suite has four current-main baseline failures in unrelated files; GitHub CI remains the authoritative supported-environment full run.
Documentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/A (no config key changed)CONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
No screenshot included. The behavior was verified live in a Slack Agent/Assistant DM and through focused deterministic regressions.