fix: streamline settings and context status
Settings Center navigation was hard to read and constrained form content, while Runtime customization duplicated headings and save actions and could lose drafts. Settings now uses readable navigation and wider content, saves base and native Runtime settings together, protects drafts, and presents one compact capabilities and defaults section. Conversation context meters could retain display-only thresholds from old Runtime settings. They now persist only measured usage, derive compression lines from current Runtime and model settings, and normalize legacy snapshots when loading them. The static website now uses the project GitHub Pages canonical URL and includes a validated Pages deployment workflow. Release note: 优化设置中心和 Agent Runtime 配置流程,避免重复标题、重复保存和未保存定制丢失;压缩线会随当前设置即时更新,官网也可通过 GitHub Pages 自动部署。
This commit is contained in:
@@ -1466,9 +1466,6 @@ describe('AssistantDatabase', () => {
|
||||
contextMetrics: {
|
||||
runtimeSelectionKey: `model:${channelDefaultProfileId}`,
|
||||
contextTokens: 9_000,
|
||||
effectiveTriggerTokens: 20_000,
|
||||
contextWindowTokens: 32_000,
|
||||
compressionEnabled: true,
|
||||
source: 'estimated' as const,
|
||||
basis: 'conversation' as const
|
||||
},
|
||||
@@ -1574,6 +1571,26 @@ describe('AssistantDatabase', () => {
|
||||
)
|
||||
|
||||
const durable = new DatabaseSync(databasePath)
|
||||
const contextStateRow = durable
|
||||
.prepare(
|
||||
`SELECT context_state_json
|
||||
FROM conversations
|
||||
WHERE id = ?`
|
||||
)
|
||||
.get(conversationId) as {
|
||||
context_state_json: string
|
||||
}
|
||||
const contextState = JSON.parse(
|
||||
contextStateRow.context_state_json
|
||||
) as {
|
||||
contextMetrics?: unknown
|
||||
}
|
||||
expect(contextState.contextMetrics).toEqual({
|
||||
runtimeSelectionKey: `model:${channelDefaultProfileId}`,
|
||||
contextTokens: 9_000,
|
||||
source: 'estimated',
|
||||
basis: 'conversation'
|
||||
})
|
||||
expect(
|
||||
durable
|
||||
.prepare(
|
||||
@@ -1595,6 +1612,32 @@ describe('AssistantDatabase', () => {
|
||||
request_id: null
|
||||
}
|
||||
])
|
||||
durable
|
||||
.prepare(
|
||||
`UPDATE conversations
|
||||
SET context_state_json = ?
|
||||
WHERE id = ?`
|
||||
)
|
||||
.run(
|
||||
JSON.stringify({
|
||||
contextMetrics: {
|
||||
runtimeSelectionKey: `model:${channelDefaultProfileId}`,
|
||||
contextTokens: 9_000,
|
||||
effectiveTriggerTokens: 20_000,
|
||||
contextWindowTokens: 32_000,
|
||||
compressionEnabled: true,
|
||||
source: 'estimated',
|
||||
basis: 'conversation'
|
||||
}
|
||||
}),
|
||||
conversationId
|
||||
)
|
||||
expect(database.getConversation(conversationId).contextMetrics).toEqual({
|
||||
runtimeSelectionKey: `model:${channelDefaultProfileId}`,
|
||||
contextTokens: 9_000,
|
||||
source: 'estimated',
|
||||
basis: 'conversation'
|
||||
})
|
||||
durable.close()
|
||||
database.close()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user