Clarify Bifrost dispatch receipts

This commit is contained in:
Meta Vens 2026-05-21 00:57:12 +01:00
commit d68d4240e2
2 changed files with 17 additions and 9 deletions

View file

@ -119,7 +119,7 @@ node .\tools\agent-transport.mjs apply-snapshot --in E:\tmp\bifrost-agent-transp
`enqueue` also mirrors the queued request into `#bifrost` by default. Use `--mirror-content-file` when a Face has a better human-facing line than the fallback receipt; use `--mirror-dry-run true` only for smoke tests.
Dispatch receipts should use Bifrost's own public persona in the Bifrost governance channel. `tools/dispatch-agent-requests.mjs` reads `BIFROST_DISCORD_CHANNEL_ID` or `DISCORD_BIFROST_CHANNEL_ID` for the receipt target, uses persona name `Bifrost`, and defaults the persona avatar to the public `src/Bifrost.Web/wwwroot/img/bifrost-profile.png` raw GitHub URL unless `BIFROST_DISCORD_PERSONA_AVATAR_URL` or `DISCORD_PERSONA_AVATAR_URL_BIFROST` overrides it.
Dispatch receipts should use Bifrost's own public persona in the Bifrost governance channel. `tools/dispatch-agent-requests.mjs` reads `BIFROST_DISCORD_CHANNEL_ID` or `DISCORD_BIFROST_CHANNEL_ID` for the receipt target, uses persona name `Bifrost`, and defaults the persona avatar to the public `src/Bifrost.Web/wwwroot/img/bifrost-profile.png` raw GitHub URL unless `BIFROST_DISCORD_PERSONA_AVATAR_URL` or `DISCORD_PERSONA_AVATAR_URL_BIFROST` overrides it. Receipt text must lead with the concrete repo and work title, not a generic "recent consensus" summary, and must not expose request ids, workspace paths, log paths, or other debugging debris in Discord.
The `snapshot` command writes a MessagePack-encoded `cultnet.snapshot_response_raw.v0` message. This keeps CultCache payload bytes intact for peers that share the document binding.

View file

@ -400,14 +400,7 @@ function postDispatchReceipt(request, dispatchRecord, options) {
optionalString(process.env.BIFROST_DISCORD_PERSONA_AVATAR_URL) ??
optionalString(process.env.DISCORD_PERSONA_AVATAR_URL_BIFROST) ??
defaultPersonaAvatarUrl;
const topic = summarizeRequestTopic(request);
const content = [
`Bifrost dispatch: ${request.targetAgentIdentity ?? "repo agent"} has this.`,
``,
`**${request.targetRepoName}: ${topic}**`,
``,
`A Codex turn is open in the ${request.targetRepoName} workspace. Keep sharpening the answer in here; the work is no longer waiting for a claimant.`,
].join("\n");
const content = renderDispatchReceiptContent(request);
runNodeJson([
bridgeCli,
@ -428,6 +421,21 @@ function resolveDispatchReceiptChannelId(options) {
);
}
function renderDispatchReceiptContent(request) {
const topic = summarizeRequestTopic(request);
const actor = request.targetAgentIdentity
? `${request.targetAgentIdentity} / ${request.targetRepoName}`
: request.targetRepoName;
return [
`Bifrost dispatch receipt`,
``,
`**${request.targetRepoName}: ${topic}**`,
``,
`Codex has started a turn for ${actor}. The claim is now specific enough to inspect, and the work is no longer sitting unclaimed in chat.`,
`Keep discussion here if it sharpens this request; Bifrost will carry the result back across the bridge.`,
].join("\n");
}
class CodexAppServerClient {
constructor({ command, logPath }) {
this.command = command;