agency: --spawn-topic flag, in-place by default, persistent ✓ buttons#103
Merged
MagMueller merged 1 commit intomainfrom May 7, 2026
Merged
agency: --spawn-topic flag, in-place by default, persistent ✓ buttons#103MagMueller merged 1 commit intomainfrom
MagMueller merged 1 commit intomainfrom
Conversation
Three coherent changes from real-use feedback. 1. Yes-tap routing — opt-in spawn, in-place by default ───────────────────────────────────────────────────────── New `--spawn-topic` flag on agency-report. Default off → Yes/Edit dispatch in the same thread the card lives in. Set the flag for the /agency loop's half-hourly cards (so each cycle's cards live in their own threads) and any case where the work warrants a dedicated topic. Schema: new spawn_topic INTEGER NOT NULL DEFAULT 0 column on suggestions, populated via agency_db.insert(spawn_topic=...). ALTER TABLE migration in init_schema with duplicate-column swallow so re-runs are idempotent. Bot side: _handle_agency_callback reads sugg_row["spawn_topic"]; spawn=1 → createForumTopic + dispatch in new thread (existing path); spawn=0 → dispatch in target_thread (the thread the card lives in). No auto-protection: agents inside an existing worker topic can still set --spawn-topic and fork yet another topic; honoring the flag without override is the design. 2. Persistent ✓ buttons (no more keyboard strip) ───────────────────────────────────────────────────────── Default kinds (action / dismiss / refine) used to strip the keyboard after a tap as a "final decision" signal. That made every answered card visually identical to a fresh one, so across a 30-card /agency feed "did I answer this one?" was unreadable. Now: the keyboard stays. _agency_mark_picked grows a reset_others flag — for default kinds it strips ✓ from every other button before marking the tapped one (only the latest pick is highlighted, user can re-tap to change their mind). Custom buttons keep additive behavior (multi-tap stacks for "Send draft A" + "Send draft B"). Drops the universal 🔥 setMessageReaction call introduced in the previous commit — the ✓ on the button itself is the at-a-glance marker. 3. Image is optional ───────────────────────────────────────────────────────── Updated docstring + the agency SKILL.md (in this repo? no — in ~/.claude/skills/agency/SKILL.md, local-only) to clarify: skip the image when the card is text-only. placehold.co labels longer than ~6 words shrink to unreadable on phone — render a real chart with matplotlib + --image-file or skip the image entirely. Doc updates in agency-report's docstring cover the routing behavior and image-is-optional rule for any future contributor reading the file directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
MagMueller
pushed a commit
that referenced
this pull request
May 8, 2026
Magnus reviewed 5 candidate styles posted as cards in TG and picked Style A — bold uppercase letters wrapped with framing arrows. The trailing " ✓" suffix shipped in #104 was visible-but-subtle: easy to miss at phone scale next to a button label that already leads with a colorful icon. Style A makes the picked button visibly heavier than its siblings regardless of icon shape. Picked transformation: ✅ Yes → ▶ ✅ 𝗬𝗘𝗦 ◀ ⏭ Skip → ▶ ⏭ 𝗦𝗞𝗜𝗣 ◀ ✏️ Edit → ▶ ✏️ 𝗘𝗗𝗜𝗧 ◀ Send draft A → ▶ 𝗦𝗘𝗡𝗗 𝗗𝗥𝗔𝗙𝗧 𝗔 ◀ Bold uppercase uses Mathematical Sans-Serif Bold (U+1D5D4 onward). Emojis, digits, and punctuation pass through unchanged. Restoring the original label on un-pick uses the suggestion's buttons_json from agency.db (lossless). When buttons_json isn't available we fall back to lossy un-bold (case collapses to upper) — acceptable for the default Yes/Skip/Edit set since "YES" is fine. Module-level helpers added: _agency_bold_upper, _agency_unbold, _agency_pick_label, _agency_is_picked, _agency_strip_legacy_marks, _agency_unpick_label. Legacy "✓ " prefix (#103) and " ✓" suffix (#104) marks are still recognized + cleaned up on the next tap so in-flight cards from before this change tidy up automatically. Default kinds (action/dismiss/refine) keep reset_others=True so only the latest pick is highlighted. Custom kinds stay additive so variant-picker patterns ("Send draft A" + "Send draft B") still stack visibly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
MagMueller
added a commit
that referenced
this pull request
May 8, 2026
Magnus reviewed 5 candidate styles posted as cards in TG and picked Style A — bold uppercase letters wrapped with framing arrows. The trailing " ✓" suffix shipped in #104 was visible-but-subtle: easy to miss at phone scale next to a button label that already leads with a colorful icon. Style A makes the picked button visibly heavier than its siblings regardless of icon shape. Picked transformation: ✅ Yes → ▶ ✅ 𝗬𝗘𝗦 ◀ ⏭ Skip → ▶ ⏭ 𝗦𝗞𝗜𝗣 ◀ ✏️ Edit → ▶ ✏️ 𝗘𝗗𝗜𝗧 ◀ Send draft A → ▶ 𝗦𝗘𝗡𝗗 𝗗𝗥𝗔𝗙𝗧 𝗔 ◀ Bold uppercase uses Mathematical Sans-Serif Bold (U+1D5D4 onward). Emojis, digits, and punctuation pass through unchanged. Restoring the original label on un-pick uses the suggestion's buttons_json from agency.db (lossless). When buttons_json isn't available we fall back to lossy un-bold (case collapses to upper) — acceptable for the default Yes/Skip/Edit set since "YES" is fine. Module-level helpers added: _agency_bold_upper, _agency_unbold, _agency_pick_label, _agency_is_picked, _agency_strip_legacy_marks, _agency_unpick_label. Legacy "✓ " prefix (#103) and " ✓" suffix (#104) marks are still recognized + cleaned up on the next tap so in-flight cards from before this change tidy up automatically. Default kinds (action/dismiss/refine) keep reset_others=True so only the latest pick is highlighted. Custom kinds stay additive so variant-picker patterns ("Send draft A" + "Send draft B") still stack visibly. Co-authored-by: bux <bux@browser-use.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Three behavior changes from real-use feedback.
1. `--spawn-topic` opt-in (default = run in-place)
Was: every Yes-tap created a new forum topic. Cards posted inside an existing worker topic spawned more topics on Yes — recursive nesting.
Now: default is in-place dispatch in the same thread the card lives in. Pass `--spawn-topic` when you specifically want a fresh topic — primarily for the `/agency` loop's half-hourly cards (each cycle deserves its own thread). No auto-protection: an agent inside a worker topic can still set `--spawn-topic` to fork another topic; the flag is honored without override.
Schema: new `spawn_topic INTEGER NOT NULL DEFAULT 0` column on `suggestions`. Migration via `ALTER TABLE` with duplicate-column swallow in `init_schema`, so existing DBs upgrade idempotently on first `agency_db.conn()`.
2. Persistent ✓ buttons replace keyboard-strip + 🔥 reaction
Default kinds (Yes / Skip / Edit) used to strip the keyboard after a tap. That made every answered card visually identical to a fresh one — across a 30-card feed, "did I answer this one?" was unreadable. PR #102 added a 🔥 reaction as a workaround marker.
Now: the keyboard stays. `_agency_mark_picked` grows a `reset_others` flag — for default kinds it strips ✓ from every other button before marking the tapped one (only the latest pick is highlighted, user can re-tap to change their mind). Custom buttons keep additive behavior (multi-tap stacks for variant-pickers like "Send draft A" + "Send draft B").
Drops the `setMessageReaction` call from #102 — the ✓ on the button is the at-a-glance marker.
3. Docstring updates
`agency-report` docstring now describes the spawn semantics, image-is-optional rule, and the "variable expandable count" pattern. Local skill file (not in this repo) carries the longer guidance about smart button labels and the multi-variant pattern for high-uncertainty asks.
Test plan
Summary by cubic
Make topic spawning opt-in with
--spawn-topicso Yes/Edit run in-place by default. Keep ✓ selections visible on buttons for quick at-a-glance state, and update docs for routing and image guidance.New Features
--spawn-topictoagency-report; default is in-place dispatch in the current thread. Use for/agencycycle cards or tasks that need their own topic.Migration
spawn_topic INTEGER NOT NULL DEFAULT 0tosuggestions. Applied automatically ininit_schemawith idempotentALTER TABLE. No manual steps.Written for commit a0849cf. Summary will update on new commits.