Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

fix(chat-history): accept paging metadata on search

CloudTianTianfc5feb691054
diff --git a/src/main/model/core-agent/chat-history-tools.ts b/src/main/model/core-agent/chat-history-tools.ts
index d278419d..34c56c1d 100644
--- a/src/main/model/core-agent/chat-history-tools.ts
+++ b/src/main/model/core-agent/chat-history-tools.ts
@@ -603,7 +603,10 @@ function createChatReadTool(opts: ChatHistoryToolsOpts): AgentTool {
type ChatHistoryAction = 'search' | 'read';
const CHAT_HISTORY_ACTION_FIELDS: Readonly<Record<ChatHistoryAction, ReadonlySet<string>>> = {
- search: new Set(['action', 'query', 'k', 'scope', 'include_current']),
+ // `page` is part of the consolidated provider-visible schema. Some
+ // providers populate that schema-valid field even for search, so tolerate
+ // and ignore it instead of rejecting an otherwise valid search call.
+ search: new Set(['action', 'query', 'k', 'scope', 'include_current', 'page']),
// Legacy flat paging fields remain execution-only for model calls copied
// from an older conversation. The provider-visible schema advertises only
// the tagged `page` contract.
diff --git a/test/main/model/core-agent/chat-history-tools.test.ts b/test/main/model/core-agent/chat-history-tools.test.ts
index fcf6d8a5..3537012c 100644
--- a/test/main/model/core-agent/chat-history-tools.test.ts
+++ b/test/main/model/core-agent/chat-history-tools.test.ts
@@ -598,6 +598,22 @@ describe('chat-history-tools › shape', () => {
expect(crossActionField.content).toContain('unsupported field(s): query');
});
+ it('accepts schema-valid read paging metadata on search and ignores it', async () => {
+ writeConversation('search-page-compat', 'Search paging compatibility', [
+ { id: 'm0', ts: '2026-01-01T00:00:00Z', from: 'user', text: 'find schemaunionword here' },
+ ]);
+ const [, , chatHistory] = await createChatHistoryActions({ userId: TEST_UID });
+
+ const result = await chatHistory.execute({
+ action: 'search',
+ query: 'schemaunionword',
+ page: { mode: 'latest', count: 10 },
+ }, ctxFor());
+
+ expect(result.isError).toBeFalsy();
+ expect(result.content).toContain('cid=search-page-compat');
+ });
+
it('fails current scope closed when the host omitted the turn boundary', async () => {
const [chatSearch, chatRead] = await createChatHistoryActions({
userId: TEST_UID,