Skip to content

feat(acp): add channel description/topic/purpose to [Context] block#1230

Open
tlongwell-block wants to merge 1 commit into
mainfrom
eva/context-channel-fields
Open

feat(acp): add channel description/topic/purpose to [Context] block#1230
tlongwell-block wants to merge 1 commit into
mainfrom
eva/context-channel-fields

Conversation

@tlongwell-block

Copy link
Copy Markdown
Collaborator

What

The agent [Context] block rendered only the channel name + scope. This adds the channel's description, topic, and purpose.

[Context]
Scope: channel
Channel: engineering (#...)
Description: where eng happens
Topic: Q3 roadmap
Purpose: coordinate release planning
Hint: ...

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/purpose tags (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 at buzz channels get so the prompt stays compact. Empty/whitespace fields render no line.

Both ingestion paths

  • relay.rs — discovery-time ChannelInfo cache (parsed in merge_discovered_channels)
  • pool.rs — on-demand fetch_channel_info fallback

Out 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-acp green (351 passed). clippy + fmt clean.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant