mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:10:45 +00:00
fix: Align silent reply prompt guidance (#70954)
* Align silent reply prompt guidance * Pass explicit silent reply conversation types * Handle dm alias in direct prompt guidance * Respect policy session type for routed replies * Preserve routed silent reply policy type * Propagate silent reply dispatcher chat type * Align prompt silent reply target policy * Avoid direct silent fallback prompt token * Use inbound key for prompt silent policy * Rewrite direct silent replies in dispatcher
This commit is contained in:
@@ -10,7 +10,11 @@ import { resolveBootstrapContextForRun } from "../../../src/agents/bootstrap-fil
|
||||
import { buildEmbeddedSystemPrompt } from "../../../src/agents/pi-embedded-runner/system-prompt.js";
|
||||
import { buildAgentSystemPrompt } from "../../../src/agents/system-prompt.js";
|
||||
import { createStubTool } from "../../../src/agents/test-helpers/pi-tool-stubs.js";
|
||||
import { buildGroupChatContext, buildGroupIntro } from "../../../src/auto-reply/reply/groups.js";
|
||||
import {
|
||||
buildDirectChatContext,
|
||||
buildGroupChatContext,
|
||||
buildGroupIntro,
|
||||
} from "../../../src/auto-reply/reply/groups.js";
|
||||
import {
|
||||
buildInboundMetaSystemPrompt,
|
||||
buildInboundUserContextPrefix,
|
||||
@@ -118,6 +122,14 @@ function buildAutoReplySystemPrompt(params: {
|
||||
}) {
|
||||
const extraSystemPromptParts = [
|
||||
buildInboundMetaSystemPrompt(params.sessionCtx),
|
||||
params.sessionCtx.ChatType === "direct" || params.sessionCtx.ChatType === "dm"
|
||||
? buildDirectChatContext({
|
||||
sessionCtx: params.sessionCtx,
|
||||
silentToken: SILENT_REPLY_TOKEN,
|
||||
silentReplyPolicy: "disallow",
|
||||
silentReplyRewrite: true,
|
||||
})
|
||||
: "",
|
||||
params.includeGroupChatContext ? buildGroupChatContext({ sessionCtx: params.sessionCtx }) : "",
|
||||
params.includeGroupIntro
|
||||
? buildGroupIntro({
|
||||
@@ -179,7 +191,7 @@ function createDirectScenario(workspaceDir: string): PromptScenario {
|
||||
OriginatingChannel: "slack",
|
||||
OriginatingTo: "D123",
|
||||
AccountId: "A1",
|
||||
ChatType: "direct",
|
||||
ChatType: "dm",
|
||||
SenderId: "U1",
|
||||
SenderName: "Alice",
|
||||
Body: "hi",
|
||||
|
||||
Reference in New Issue
Block a user