fix: never split replies into multiple messages (Fabric has no length limit)
Unlike Discord, Fabric has no message-length cap. Single-chunk chunker (text -> [text]), textChunkLimit=MAX_SAFE_INTEGER, capabilities blockStreaming=false, replyOptions.disableBlockStreaming=true -> every agent reply delivered as exactly one Fabric message. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
11
dist/fabric/src/channel.js
vendored
11
dist/fabric/src/channel.js
vendored
@@ -93,7 +93,9 @@ export const fabricChannelPlugin = createChatChannelPlugin({
|
|||||||
threads: false,
|
threads: false,
|
||||||
media: false,
|
media: false,
|
||||||
nativeCommands: false,
|
nativeCommands: false,
|
||||||
blockStreaming: true,
|
// Fabric has no message-length limit and we never want a reply split
|
||||||
|
// into multiple messages -> no block streaming.
|
||||||
|
blockStreaming: false,
|
||||||
},
|
},
|
||||||
reload: { configPrefixes: ['channels.fabric'] },
|
reload: { configPrefixes: ['channels.fabric'] },
|
||||||
config: {
|
config: {
|
||||||
@@ -126,7 +128,12 @@ export const fabricChannelPlugin = createChatChannelPlugin({
|
|||||||
},
|
},
|
||||||
threading: { topLevelReplyToMode: 'channel' },
|
threading: { topLevelReplyToMode: 'channel' },
|
||||||
outbound: {
|
outbound: {
|
||||||
base: {},
|
base: {
|
||||||
|
deliveryMode: 'direct',
|
||||||
|
// Fabric has no length limit: never chunk — always one message.
|
||||||
|
chunker: (text) => [text],
|
||||||
|
textChunkLimit: Number.MAX_SAFE_INTEGER,
|
||||||
|
},
|
||||||
attachedResults: {
|
attachedResults: {
|
||||||
channel: 'fabric',
|
channel: 'fabric',
|
||||||
sendText: async (ctx) => {
|
sendText: async (ctx) => {
|
||||||
|
|||||||
3
dist/fabric/src/inbound.js
vendored
3
dist/fabric/src/inbound.js
vendored
@@ -144,7 +144,8 @@ export class FabricInbound {
|
|||||||
},
|
},
|
||||||
onRecordError: (err) => this.log.warn(`fabric: session record failed agent=${agentId}: ${String(err)}`),
|
onRecordError: (err) => this.log.warn(`fabric: session record failed agent=${agentId}: ${String(err)}`),
|
||||||
onDispatchError: (err, info) => this.log.warn(`fabric: ${info.kind} dispatch failed agent=${agentId}: ${String(err)}`),
|
onDispatchError: (err, info) => this.log.warn(`fabric: ${info.kind} dispatch failed agent=${agentId}: ${String(err)}`),
|
||||||
replyOptions: {},
|
// Fabric has no length limit: deliver the whole reply as ONE message.
|
||||||
|
replyOptions: { disableBlockStreaming: true },
|
||||||
});
|
});
|
||||||
this.log.info(`fabric: dispatch returned agent=${agentId} channel=${channelId}`);
|
this.log.info(`fabric: dispatch returned agent=${agentId} channel=${channelId}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,9 @@ export const fabricChannelPlugin = createChatChannelPlugin<ResolvedFabricAccount
|
|||||||
threads: false,
|
threads: false,
|
||||||
media: false,
|
media: false,
|
||||||
nativeCommands: false,
|
nativeCommands: false,
|
||||||
blockStreaming: true,
|
// Fabric has no message-length limit and we never want a reply split
|
||||||
|
// into multiple messages -> no block streaming.
|
||||||
|
blockStreaming: false,
|
||||||
},
|
},
|
||||||
reload: { configPrefixes: ['channels.fabric'] },
|
reload: { configPrefixes: ['channels.fabric'] },
|
||||||
config: {
|
config: {
|
||||||
@@ -142,7 +144,12 @@ export const fabricChannelPlugin = createChatChannelPlugin<ResolvedFabricAccount
|
|||||||
threading: { topLevelReplyToMode: 'channel' },
|
threading: { topLevelReplyToMode: 'channel' },
|
||||||
|
|
||||||
outbound: {
|
outbound: {
|
||||||
base: {},
|
base: {
|
||||||
|
deliveryMode: 'direct',
|
||||||
|
// Fabric has no length limit: never chunk — always one message.
|
||||||
|
chunker: (text: string) => [text],
|
||||||
|
textChunkLimit: Number.MAX_SAFE_INTEGER,
|
||||||
|
},
|
||||||
attachedResults: {
|
attachedResults: {
|
||||||
channel: 'fabric',
|
channel: 'fabric',
|
||||||
sendText: async (ctx: {
|
sendText: async (ctx: {
|
||||||
|
|||||||
@@ -176,7 +176,8 @@ export class FabricInbound {
|
|||||||
this.log.warn(`fabric: session record failed agent=${agentId}: ${String(err)}`),
|
this.log.warn(`fabric: session record failed agent=${agentId}: ${String(err)}`),
|
||||||
onDispatchError: (err: unknown, info: { kind: string }) =>
|
onDispatchError: (err: unknown, info: { kind: string }) =>
|
||||||
this.log.warn(`fabric: ${info.kind} dispatch failed agent=${agentId}: ${String(err)}`),
|
this.log.warn(`fabric: ${info.kind} dispatch failed agent=${agentId}: ${String(err)}`),
|
||||||
replyOptions: {},
|
// Fabric has no length limit: deliver the whole reply as ONE message.
|
||||||
|
replyOptions: { disableBlockStreaming: true } as never,
|
||||||
});
|
});
|
||||||
this.log.info(`fabric: dispatch returned agent=${agentId} channel=${channelId}`);
|
this.log.info(`fabric: dispatch returned agent=${agentId} channel=${channelId}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user