feat(acp): add channel description/topic/purpose to [Context] block#1230
Open
tlongwell-block wants to merge 1 commit into
Open
feat(acp): add channel description/topic/purpose to [Context] block#1230tlongwell-block wants to merge 1 commit into
tlongwell-block wants to merge 1 commit into
Conversation
The agent [Context] block rendered only the channel name. This adds the channel's description, topic, and purpose — already carried as about/topic/ purpose tags on the NIP-29 group metadata event the harness fetches, so no extra relay round-trips. Each field inlines verbatim when under a 200-char budget; longer values collapse to a placeholder pointing at `buzz channels get` to keep the prompt compact. Fields are wired through both ingestion paths: the discovery-time ChannelInfo cache (relay.rs) and the on-demand fetch_channel_info fallback (pool.rs). Canvas is deliberately out of scope: it is a separate event kind (40100), not on the metadata event, so surfacing it costs an extra fetch — left as a follow-up. Co-authored-by: Tyler Longwell <tlongwell@block.xyz> Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
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
The agent
[Context]block rendered only the channel name + scope. This adds the channel's description, topic, and purpose.Why it's cheap
All three already ride on the NIP-29 group metadata event the harness already fetches — the relay writes them as
about/topic/purposetags (buzz-relay/.../side_effects.rs). So zero extra relay round-trips: just read three more tags.Budget logic
Per Tyler's ask: each field inlines verbatim when under a 200-char budget (
CHANNEL_FIELD_INLINE_BUDGET); longer values collapse to a placeholder pointing atbuzz channels getso the prompt stays compact. Empty/whitespace fields render no line.Both ingestion paths
relay.rs— discovery-timeChannelInfocache (parsed inmerge_discovered_channels)pool.rs— on-demandfetch_channel_infofallbackOut of scope (deliberate)
Canvas. It's a separate event kind (40100), not on the metadata event, so even a "this channel has a canvas" placeholder costs an extra fetch per prompt — unlike the three free fields here. Left as a follow-up so the fetch strategy (always? cached?) gets its own decision.
Tests
8 new unit tests covering inline / placeholder / empty / exact-budget boundary / all-three-rendered / channel-scope integration. Full
cargo test -p buzz-acpgreen (351 passed). clippy + fmt clean.