feat(discord): add persistent workspace header cards#67333
Open
marcelomediagroup wants to merge 7 commits into
Open
feat(discord): add persistent workspace header cards#67333marcelomediagroup wants to merge 7 commits into
marcelomediagroup wants to merge 7 commits into
Conversation
The contract check used `payload["version"] != 1`, but `1.0 == 1` in Python, so a float `1.0` (and any equal numeric) silently validated as a v1 card. Require an exact `int` (bool already excluded) so only the integer 1 passes. Also replace the `test_constant_sets_match_the_values_accepted_by_the_parser` change-detector (forbidden per AGENTS.md — froze CARD_TYPES/SEVERITIES against literal sets) with invariants that assert the real contract: every declared card_type/severity is accepted by the parser and values outside the declared sets are rejected. Adds float/bool/str version rejection cases. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GF1F5oXakwS4N5cL8PFCme
…afely A contract-valid operator card can still exceed Discord's embed budgets — up to 12 fields at the 1024-char field ceiling, or a link block wider than one field, blows past both the per-field 1024 and aggregate 6000 limits. Discord rejects an oversized embed wholesale (HTTP 400 / code 50035), dropping the entire message. `_build_operator_card_embed` now truncates each part to its per-element ceiling (UTF-16 aware) and stops adding fields once the running aggregate would overflow, so the embed is always API-valid; the full card still reaches the operator via the plaintext `render_operator_card_text` content that rides alongside it. Also fix the forum thread title: it used a naive `[:100]` slice, which counts code points, not Discord's UTF-16 code units. Route it through the shared `_truncate_discord_component_text` helper like every other Discord component label. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GF1F5oXakwS4N5cL8PFCme
Collaborator
Related to #67224: this stack adds the distinct persistent Discord workspace-header and safe-backfill layer on top of that operator-card contract. |
teknium1
reviewed
Jul 19, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the careful persistence, corruption, and duplicate-prevention work. I found one blocking completeness gap.
Problems
plugins/platforms/discord/workspace_headers.py:333addsWorkspaceHeaderStore.update_state(), but the PR provides no production caller.plugins/platforms/discord/adapter.py:6638-6643only reads state and renders the card. The only PR-diff invocation is direct test setup attests/gateway/test_discord_workspace_headers.py:89, so metadata changes cannot actually update the persisted header as the PR summary claims.
Suggested changes
- Connect an explicit production metadata input to
update_state()(or narrow the feature to static headers), then add an end-to-end adapter test that changes that input and verifies the tracked header is edited.
Automated hermes-sweeper review.
| self._write_unlocked(workspaces) | ||
| return WorkspaceHeaderBinding(scope_key, thread_key, message_key) | ||
|
|
||
| def update_state( |
Contributor
There was a problem hiding this comment.
update_state() has no production caller in this PR: the only diff invocation is test setup, while ensure_workspace_header() only reads this state before rendering. Please wire the intended metadata producer through this method and cover that edit path, or remove/narrow the mutable metadata contract.
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.
Summary
Stack dependency
Depends on #67224. This branch is based on exact reviewed head 5f84aa5.
The OE-178-only review range is:
5f84aa5..93d0277
Verification
Safety
No live Discord mutation was performed. Backfill remains dry-run by default; apply requires the explicit flag and live per-candidate revalidation.