feat(tools): fabric-guild-list returns serviceEndpoint for announce targets

FabricSession.guilds type + fabric-guild-list response now carry the
new serviceEndpoint field (added to GuildNode in Fabric.Backend.Center).
The tool description teaches agents the distinction: 'endpoint' is the
client-facing URL (which they themselves use to call the guild from
plugin context), 'serviceEndpoint' is what to plumb into
dialectic_propose_topic's announce_guild_base_url so the dialectic
backend can dial it from inside the deployment.

Fixes bug #2 from the first e2e debate run: agent-supplied
'http://server.t3:7002' wasn't backend-reachable; agent now
supplies 'http://fabric-backend-guild:7002' via serviceEndpoint
and broadcasts actually land.
This commit is contained in:
h z
2026-05-23 22:21:03 +01:00
parent 0e36457d8f
commit 8963f3ca00
2 changed files with 23 additions and 4 deletions

View File

@@ -367,10 +367,15 @@ export function registerFabricTools(
name: 'fabric-guild-list',
description:
'List guilds the calling agent is a member of. Returns ' +
'{nodeId, name, purpose, status} per row. `purpose` is a free-form ' +
"description of what each guild is for. Use this BEFORE " +
'fabric-channel-list when a workflow asks you to pick the ' +
'right guild by intent (no guild ids hardcoded into workflows).',
'{nodeId, name, purpose, status, serviceEndpoint} per row. ' +
"`purpose` is a free-form description of what each guild is for " +
'pick the guild whose purpose matches your intent. ' +
'`serviceEndpoint` is the internal URL another backend service ' +
'uses to reach this guild (NOT the client-facing url): pass it as ' +
'`announce_guild_base_url` to dialectic_propose_topic when you ' +
'want the dialectic-backend to broadcast topic lifecycle to a ' +
"channel in this guild. Use this tool BEFORE fabric-channel-list " +
'when a workflow asks you to pick the right guild by intent.',
parameters: {
type: 'object',
additionalProperties: false,
@@ -411,6 +416,13 @@ export function registerFabricTools(
name: g.name,
status: g.status,
purpose: g.purpose ?? null,
// serviceEndpoint is what an in-deployment service uses to
// reach this guild — pass this into announce_guild_base_url
// on dialectic_propose_topic, NOT the client-facing endpoint.
// Null when the admin hasn't configured it (broadcasts will
// fail until set; ask hangman to run
// `cli node set-service-endpoint --node-id <id> --endpoint <url>`).
serviceEndpoint: g.serviceEndpoint ?? null,
})),
};
},