Skip to content

Commit a47d4d5

Browse files
author
linyuan.yang
committed
up
1 parent 614f138 commit a47d4d5

7 files changed

Lines changed: 63 additions & 63 deletions

File tree

‎packages/admin/src/i18n/en.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ export default {
185185
section_resources: 'Resources',
186186
section_advanced: 'Advanced',
187187
section_channel_advanced: 'Channel Advanced',
188-
channel_profile: 'Default Session Profile',
189-
channel_profile_hint: 'Only applies to newly created db sessions; existing sessions are not switched automatically',
190-
channel_profile_none: 'None (new sessions stay independent)',
191188
section_common: 'Common',
192189
section_resources_workspace: 'Knowledge & Workspace',
193190
section_automation_memory: 'Automation Memory',

‎packages/admin/src/i18n/zh.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ export default {
185185
section_resources: '资源配置',
186186
section_advanced: '高级设置',
187187
section_channel_advanced: '频道高级设置',
188-
channel_profile: '默认会话 Profile',
189-
channel_profile_hint: '仅影响之后新建的 db session;已有会话不会自动切换',
190-
channel_profile_none: '不指定(新会话独立配置)',
191188
section_common: '常用',
192189
section_resources_workspace: '知识与工作区',
193190
section_automation_memory: '自动化记忆',

‎packages/admin/src/views/chat/ChannelsView.vue‎

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ function formatTokens(n: number): string {
397397
const showModal = ref(false)
398398
const editingId = ref<string | null>(null)
399399
const form = ref<ChannelConfig>({
400-
name: '', type: '', config: {}, profileId: undefined, agent: '', saver: '', notes: [],
400+
name: '', type: '', config: {}, agent: '', saver: '', notes: [],
401401
workPath: '', streamVerbose: false, autoApproveAllTools: false,
402402
disableWorkspaceContext: false, disableWorkspaceSkills: false,
403403
approvalTimeout: 0, approvalTimeoutValue: ApprovalTimeoutValue.Deny,
@@ -458,7 +458,6 @@ const formTriggerToolsMode = ref<ToolMode>('default')
458458
459459
const channelAdvancedBadge = computed(() => {
460460
let n = 0
461-
if (form.value.profileId) n++
462461
if (form.value.mergeWindow && form.value.mergeWindow > 0) n++
463462
if (formToolsMode.value !== 'default') n++
464463
if (formTriggerToolsMode.value !== 'default') n++
@@ -610,9 +609,8 @@ async function waitForQRConfirm(key: string, channelId: string | null, type: str
610609
function openAdd() {
611610
editingId.value = null
612611
clearActionState()
613-
void loadVisibleProfiles()
614612
const defaultType = plugins.value.find(p => !p.builtin)?.type || ''
615-
form.value = { name: '', type: defaultType, config: {}, profileId: undefined, agent: '', saver: '', notes: [], wikis: [], workPath: '', streamVerbose: false, autoApproveAllTools: false, disableWorkspaceContext: false, disableWorkspaceSkills: false, approvalTimeout: 0, approvalTimeoutValue: ApprovalTimeoutValue.Deny, askTimeout: 0, askTimeoutMessage: '', intentModel: '', intentPrompt: '', intentThreshold: 0.7, mergeWindow: 0 }
613+
form.value = { name: '', type: defaultType, config: {}, agent: '', saver: '', notes: [], wikis: [], workPath: '', streamVerbose: false, autoApproveAllTools: false, disableWorkspaceContext: false, disableWorkspaceSkills: false, approvalTimeout: 0, approvalTimeoutValue: ApprovalTimeoutValue.Deny, askTimeout: 0, askTimeoutMessage: '', intentModel: '', intentPrompt: '', intentThreshold: 0.7, mergeWindow: 0 }
616614
formTools.value = []
617615
formTriggerTools.value = []
618616
formToolsMode.value = 'default'
@@ -624,8 +622,7 @@ function openEdit(id: string) {
624622
const c = channels.value[id]
625623
editingId.value = id
626624
clearActionState()
627-
void loadVisibleProfiles()
628-
form.value = { name: c.name, type: c.type, config: { ...c.config }, profileId: (c as any).profileId ? Number((c as any).profileId) : undefined, agent: c.agent, saver: c.saver, notes: c.notes || [], wikis: (c as any).wikis || [], workPath: c.workPath || '', streamVerbose: !!c.streamVerbose, autoApproveAllTools: !!c.autoApproveAllTools, disableWorkspaceContext: !!c.disableWorkspaceContext, disableWorkspaceSkills: !!c.disableWorkspaceSkills, approvalTimeout: c.approvalTimeout ?? 0, approvalTimeoutValue: c.approvalTimeoutValue ?? ApprovalTimeoutValue.Deny, askTimeout: c.askTimeout ?? 0, askTimeoutMessage: c.askTimeoutMessage || '', intentModel: c.intentModel || '', intentPrompt: c.intentPrompt || '', intentThreshold: c.intentThreshold ?? 0.7, mergeWindow: c.mergeWindow || 0, memory: (c as any).memory ?? undefined, agenda: (c as any).agenda ?? undefined }
625+
form.value = { name: c.name, type: c.type, config: { ...c.config }, agent: c.agent, saver: c.saver, notes: c.notes || [], wikis: (c as any).wikis || [], workPath: c.workPath || '', streamVerbose: !!c.streamVerbose, autoApproveAllTools: !!c.autoApproveAllTools, disableWorkspaceContext: !!c.disableWorkspaceContext, disableWorkspaceSkills: !!c.disableWorkspaceSkills, approvalTimeout: c.approvalTimeout ?? 0, approvalTimeoutValue: c.approvalTimeoutValue ?? ApprovalTimeoutValue.Deny, askTimeout: c.askTimeout ?? 0, askTimeoutMessage: c.askTimeoutMessage || '', intentModel: c.intentModel || '', intentPrompt: c.intentPrompt || '', intentThreshold: c.intentThreshold ?? 0.7, mergeWindow: c.mergeWindow || 0, memory: (c as any).memory ?? undefined, agenda: (c as any).agenda ?? undefined }
629626
formTools.value = [...(c.tools ?? [])]
630627
formTriggerTools.value = [...(c.triggerTools ?? [])]
631628
formToolsMode.value = toolsToMode(c.tools)
@@ -657,7 +654,6 @@ async function save() {
657654
const payload: ChannelConfig = {
658655
name: form.value.name.trim(),
659656
type: form.value.type,
660-
profileId: form.value.profileId ? Number(form.value.profileId) : undefined,
661657
agent: form.value.agent,
662658
saver: form.value.saver,
663659
notes: form.value.notes.filter(id => validNoteIds.has(id)),
@@ -768,7 +764,6 @@ async function refresh() {
768764
<span class="session-meta-chip" :class="Array.isArray(c.notes) && c.notes.length ? '' : 'muted'">{{ t('common.note') }}: {{ Array.isArray(c.notes) && c.notes.length ? c.notes.map(nid => noteOptions.find(n => n.id === nid)?.label || nid).join(', ') : t('common.not_configured') }}</span>
769765
<span class="session-meta-chip" :class="Array.isArray((c as any).wikis) && (c as any).wikis.length ? '' : 'muted'">{{ t('common.wiki') }}: {{ Array.isArray((c as any).wikis) && (c as any).wikis.length ? (c as any).wikis.map((wid: string) => wikiOptions.find(w => w.id === wid)?.label || wid).join(', ') : t('common.not_configured') }}</span>
770766
<span class="session-meta-chip" :class="c.workPath ? 'blue' : 'muted'">{{ t('directory.path_label') }}: {{ c.workPath || t('common.not_configured') }}</span>
771-
<span v-if="c.profileId" class="session-meta-chip blue">{{ t('channels.channel_profile') }}: {{ visibleProfiles.find(p => p.id === c.profileId)?.name || c.profileId }}</span>
772767
<span class="session-meta-chip" :class="c.streamVerbose ? 'green' : 'muted'">{{ t('channels.stream_verbose') }}: {{ c.streamVerbose ? t('common.enabled') : t('common.disabled') }}</span>
773768
<span class="session-meta-chip" :class="c.autoApproveAllTools ? 'orange' : 'muted'">{{ t('settings.auto_approve_all') }}: {{ c.autoApproveAllTools ? t('common.enabled') : t('common.disabled') }}</span>
774769
<span class="session-meta-chip" :class="c.intentModel ? '' : 'muted'">{{ t('channels.intent_model') }}: {{ c.intentModel ? (modelOptions.find(m => m.id === c.intentModel)?.label || c.intentModel) : t('common.not_configured') }}</span>
@@ -914,17 +909,6 @@ async function refresh() {
914909
/>
915910

916911
<SFormDetails :summary="t('channels.section_channel_advanced')" :badge="channelAdvancedBadge">
917-
<SFormItem :label="t('channels.channel_profile')" :hint="t('channels.channel_profile_hint')">
918-
<SSelect
919-
:model-value="form.profileId ? String(form.profileId) : ''"
920-
@update:model-value="v => form.profileId = v ? Number(v) : undefined"
921-
>
922-
<option value="">{{ t('channels.channel_profile_none') }}</option>
923-
<option v-for="p in visibleProfiles" :key="p.id" :value="String(p.id)">
924-
{{ p.name }}{{ p.sessionCount && p.sessionCount > 0 ? ` (${p.sessionCount})` : '' }}
925-
</option>
926-
</SSelect>
927-
</SFormItem>
928912
<SFormItem :label="t('channels.merge_window')" :hint="t('channels.merge_window_hint')">
929913
<SInput v-model.number="form.mergeWindow" type="number" placeholder="0" />
930914
</SFormItem>

‎packages/sbot.commons/src/settings.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ export interface ChannelConfig {
263263
type: string
264264
/** 插件特有配置(appId, botToken 等) */
265265
config: Record<string, any>
266-
/** 新建 db session 时默认关联的 SessionProfile id;不设置则创建独立 auto profile */
267-
profileId?: number
268266

269267
// ── 频道级默认值(ChannelSessionRow 中同名字段可逐会话覆盖,会话值为 null 时回退到此处) ──
270268
/** Agent ID(对应 ~/.sbot/agents/<id> 目录名) */

‎packages/sbot/prompts/memory/writer/default.md‎

Lines changed: 58 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@ future conversations, and emit CRUD operations that update the memory store.
55
You are NOT in a conversation with the user. The user will never see your output
66
directly. Your only output is the structured `ops` array via the tool call.
77

8+
# North Star
9+
10+
Optimize for **future user keystrokes saved**, not just future agent tokens saved.
11+
A strong memory prevents the user from having to re-state preferences, re-explain
12+
context, or interrupt to correct the same drift twice. Most rollouts produce
13+
nothing memorable; that is the expected outcome.
14+
15+
# Minimum signal gate
16+
17+
Before you emit any `create` or `update`, ask yourself, for each candidate:
18+
19+
> "Will a future agent plausibly act better because of what I write here?"
20+
21+
If the answer is no — or "maybe, but I'm not sure" — drop the candidate. When all
22+
candidates fail the gate, emit `noop`. Inventing memory to "fill a quota" is a
23+
failure mode, not a success.
24+
25+
# Evidence weighting
26+
27+
Read **much more** into user messages than assistant messages.
28+
29+
- **Primary evidence (high weight):** user requests, corrections ("no, do X"),
30+
interruptions, redo instructions, repeated narrowing, expressed frustration,
31+
explicit confirmations ("yes, exactly that").
32+
- **Secondary evidence (lower weight):** assistant summaries, assistant
33+
proposals, assistant restatements of what the user "wants".
34+
35+
The assistant restating a fact does not promote it to durable memory. Only the
36+
user's own behavior — what they ask for, what they push back on, what they
37+
adopt — establishes durability.
38+
839
# Inputs
940

1041
You receive two things:
@@ -17,15 +48,22 @@ You receive two things:
1748

1849
# What to remember (high-signal)
1950

20-
Save only durable, cross-conversation knowledge:
21-
22-
- **User profile**: role, expertise, preferred languages, tooling, communication style
23-
- **User preferences / feedback**: explicit corrections, "stop doing X", "always do Y",
24-
approaches the user confirmed worked
25-
- **Project facts not derivable from code**: deadlines, ownership, motivations behind
26-
decisions, freeze windows, incident context
27-
- **External pointers**: dashboards, ticket systems, Slack channels, runbooks the
28-
user references during work
51+
High-signal memory is information that **changes the next agent's default
52+
behavior in a durable way**. Use these four buckets to decide:
53+
54+
1. **Stable user operating preferences.** What the user repeatedly asks for,
55+
corrects, or interrupts to enforce. What they want by default without having
56+
to restate it. ("Always reply in Chinese", "prefer SVG over PNG", "don't
57+
summarize at the end of every response".)
58+
2. **High-leverage procedural knowledge.** Hard-won shortcuts, failure shields,
59+
exact paths/commands, or repo facts that save substantial future exploration
60+
time. ("Build order: scorpio.di → scorpio.ai → sbot".)
61+
3. **Reliable task maps and decision triggers.** Where the truth lives, how to
62+
tell when a path is wrong, and what signal should cause a pivot. ("Pipeline
63+
bugs are tracked in Linear project INGEST".)
64+
4. **Durable evidence about the user's environment / workflow.** Stable tooling
65+
habits, repo conventions, deadlines, ownership, motivations behind decisions,
66+
freeze windows, incident context.
2967

3068
# What NOT to remember
3169

@@ -34,15 +72,15 @@ Skip anything that is:
3472
- Already in code, CLAUDE.md, git history, or other obvious documentation
3573
- Ephemeral conversation state ("the user is currently asking about X")
3674
- One-off questions with no general lesson
37-
- Unfinished or speculative thoughts ("the user said maybe we'll try Y later")
3875
- Anything that would not still be true 30 days from now
39-
- **One-shot deliverable specs.** If the user is scheduling a single task and
40-
articulating its requirements (size, rules, format, deadline, etc.), the spec
41-
belongs to the task — not to memory. Anything that becomes irrelevant once
42-
the task is delivered fails the "true 30 days from now" test even if today
43-
it looks like a project fact. Durable preferences embedded in such a request
44-
("I always want SVG over PNG") ARE worth extracting, but the per-deliverable
45-
bundle is not.
76+
- **Unadopted discussion.** Brainstorming, tentative design talk, exploratory
77+
proposals, requirement bundles for a single deliverable that the user has not
78+
yet implemented or repeatedly reinforced. Treat these as belonging to the
79+
conversation transcript, not to memory. A spec only becomes durable memory if
80+
the user **adopts it as a recurring rule** ("from now on, all games I ask for
81+
should be 10x10") — not because it was articulated for one task. Durable
82+
preferences embedded inside such a discussion ("I always prefer SVG over
83+
PNG") ARE worth extracting; the per-deliverable bundle is not.
4684
- Secrets, API keys, credentials — these have been redacted but DO NOT recreate them
4785
even if you somehow infer them from context
4886

@@ -98,21 +136,10 @@ An existing memory is wrong, superseded, or no longer relevant. Required: `slug`
98136
## `noop`
99137
Nothing in this rollout was worth changing. Required: `reason` (one short sentence).
100138

101-
**Default to `noop`.** Most rollouts produce nothing memorable. Do not invent
102-
content to fill a quota.
103-
104-
# Output format
105-
106-
Return ONE structured response with a single field `ops`, an array of operations.
107-
Multiple ops in one response are fine (e.g. one `create` + one `update`). Empty
108-
array is also fine — equivalent to a single `noop`.
109-
110-
# Constraints summary
139+
# Hard constraints
111140

112-
- Default to `noop`
113-
- Do NOT recreate secrets even if you saw them
114-
- A memory's `body` should NOT include the `# title` line — the system prepends it
141+
- A memory's `body` must NOT include the `# title` line — the system prepends it
115142
- Slugs must match `^[a-z0-9][a-z0-9-]{0,63}$`
116143
- `kind` must be one of `preference`, `fact`, `workflow`, `project`, `decision`, `summary`
117-
- Description is ONE line, max 200 chars, designed for the menu reader
118144
- `update` and `delete` require `reason`
145+
- Never recreate secrets even if you saw them

‎packages/sbot/skills/config-guide/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ sbot 的运行时配置全部落在用户目录 `~/.sbot/`。本 skill 把这套
4848
| `savers` | `Record<UUID, SaverConfig>` | `{ name, type: "file" \| "sqlite" \| "memory" }` |
4949
| `notes` | `Record<UUID, NoteConfig>` | `{ name, embedding: <embeddingUUID> }` |
5050
| `wikis` | `Record<UUID, WikiConfig>` | `{ name, embedding?: <embeddingUUID> }` |
51-
| `channels` | `Record<channelId, ChannelConfig>` | key 是 channelId(不是 UUID),含 type/config/profileId/agent/saver/notes |
51+
| `channels` | `Record<channelId, ChannelConfig>` | key 是 channelId(不是 UUID),含 type/config/agent/saver/notes |
5252
| `plugins` | string[] | 插件路径或包名 |
5353
| `agentSources` | `{ url, name? }[]` | Agent 商店源列表 |
5454
| `tunnel` | `TunnelConfig[]` | 隧道列表,按 `id` 唯一 |

‎packages/sbot/src/Session/ChannelDataService.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,9 @@ export class ChannelDataService {
174174
const sessionData: Record<string, any> = {};
175175
if (opts?.autoSessionName != null) sessionData.autoSessionName = opts.autoSessionName;
176176
if (opts?.sessionAvatar !== undefined) sessionData.avatar = opts.sessionAvatar;
177-
const channelProfileId = parseId(config.getChannel(channelId)?.profileId);
178-
const defaultProfileId = channelProfileId != null && channelProfileId > 0 ? channelProfileId : 0;
179-
180177
const [session, sessionCreated] = await database.findOrCreate<ChannelSessionRow>(database.channelSession, {
181178
where: { channelId, sessionId },
182-
defaults: { ...sessionData, sessionName: opts?.sessionName ?? "", profileId: defaultProfileId, createdAt: now },
179+
defaults: { ...sessionData, sessionName: opts?.sessionName ?? "", profileId: 0, createdAt: now },
183180
});
184181

185182
if (!sessionCreated) {

0 commit comments

Comments
 (0)