Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 74 additions & 23 deletions crates/agent-gateway/internal/proto/v1/gateway.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/agent-gateway/internal/server/websocket_fs_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func (c *websocketConnection) handleFsList(req websocketRequest) {
Depth *int `json:"depth"`
Offset *int `json:"offset"`
MaxResults *int `json:"max_results"`
ShowHidden *bool `json:"show_hidden"`
}

var body payload
Expand Down Expand Up @@ -216,6 +217,7 @@ func (c *websocketConnection) handleFsList(req websocketRequest) {
Depth: depth,
Offset: offset,
MaxResults: maxResults,
ShowHidden: body.ShowHidden,
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func TestWebsocketFsPayloadsUseFrontendFieldNames(t *testing.T) {
Total: 3,
HasMore: true,
Entries: []*gatewayv1.FsListEntry{
{Path: "src/components", Kind: "dir"},
{Path: "src/components", Kind: "dir", Hidden: true},
{Path: "src/app.tsx", Kind: "file"},
},
})
Expand All @@ -218,6 +218,9 @@ func TestWebsocketFsPayloadsUseFrontendFieldNames(t *testing.T) {
if entries[0]["path"] != "src/components" || entries[0]["kind"] != "dir" {
t.Fatalf("fs.list first entry = %#v", entries[0])
}
if entries[0]["hidden"] != true || entries[1]["hidden"] != false {
t.Fatalf("fs.list hidden flags = %#v", entries)
}

readEditable := websocketFsReadEditableTextResponsePayload(&gatewayv1.FsReadEditableTextResponse{
Path: "src/main.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (c *websocketConnection) handleFileMentionList(req websocketRequest) {
Workdir string `json:"workdir"`
MaxResults *int `json:"max_results"`
Query string `json:"query"`
ShowHidden *bool `json:"show_hidden"`
}

var body payload
Expand Down Expand Up @@ -72,6 +73,7 @@ func (c *websocketConnection) handleFileMentionList(req websocketRequest) {
Workdir: workdir,
MaxResults: maxResults,
Query: query,
ShowHidden: body.ShowHidden,
},
},
})
Expand All @@ -93,8 +95,9 @@ func (c *websocketConnection) handleFileMentionList(req websocketRequest) {
entries := make([]map[string]any, 0, len(resp.GetEntries()))
for _, entry := range resp.GetEntries() {
entries = append(entries, map[string]any{
"path": entry.GetPath(),
"kind": entry.GetKind(),
"path": entry.GetPath(),
"kind": entry.GetKind(),
"hidden": entry.GetHidden(),
})
}

Expand Down
5 changes: 5 additions & 0 deletions crates/agent-gateway/proto/v1/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ message ConversationSummary {
bool is_pinned = 10;
int64 pinned_at = 11;
bool is_shared = 12;
string selected_model_json = 13;
}

message HistoryGetRequest {
Expand Down Expand Up @@ -915,11 +916,13 @@ message FileMentionListRequest {
string workdir = 1;
uint32 max_results = 2;
string query = 3;
optional bool show_hidden = 4;
}

message FileMentionEntry {
string path = 1;
string kind = 2;
bool hidden = 3;
}

message FileMentionListResponse {
Expand Down Expand Up @@ -969,11 +972,13 @@ message FsListRequest {
uint32 depth = 3;
uint32 offset = 4;
uint32 max_results = 5;
optional bool show_hidden = 6;
}

message FsListEntry {
string path = 1;
string kind = 2;
bool hidden = 3;
}

message FsListResponse {
Expand Down
45 changes: 45 additions & 0 deletions crates/agent-gateway/test/webui/web-settings.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ test("web settings normalization canonicalizes project keyed maps with Windows p
query: "legacy",
selectedPath: "src\\main.ts",
expandedPaths: ["", "src", "src\\components", "src"],
showHidden: true,
revision: 2,
},
},
Expand Down Expand Up @@ -108,6 +109,7 @@ test("web settings normalization canonicalizes project keyed maps with Windows p
query: "legacy",
selectedPath: "src/main.ts",
expandedPaths: ["", "src", "src/components"],
showHidden: true,
revision: 2,
},
},
Expand Down Expand Up @@ -205,6 +207,47 @@ test("web chat runtime controls default and follow model-aware reasoning support
assert.equal(settings.isThinkingAlwaysOnForModel("claude_code", "claude-opus-4-8"), false);
assert.equal(settings.isThinkingAlwaysOnForModel("claude_code", undefined), false);

// 中转装饰过的 Anthropic id(日期后缀/大小写/@版本)按规范化后的目录条目解析,
// xhigh/max 档位与"思考不可关"语义不丢失;与桌面端 modelFactory 同步。
assert.deepEqual(
settings.getChatRuntimeReasoningLevelsForProvider({
providerId: "claude_code",
modelId: "claude-opus-4-8-20260213",
}),
["minimal", "low", "medium", "high", "xhigh", "max"],
);
assert.deepEqual(
settings.getChatRuntimeReasoningLevelsForProvider({
providerId: "claude_code",
modelId: "claude-sonnet-4-6-20251114",
}),
["minimal", "low", "medium", "high", "max"],
);
assert.equal(settings.isThinkingAlwaysOnForModel("claude_code", "Claude-Fable-5"), true);
// 目录彻底未命中的三方改名 id 走 id 启发式补 xhigh/max。
assert.deepEqual(
settings.getChatRuntimeReasoningLevelsForProvider({
providerId: "claude_code",
modelId: "claude-4.6-sonnet",
}),
["minimal", "low", "medium", "high", "max"],
);
assert.deepEqual(
settings.getChatRuntimeReasoningLevelsForProvider({
providerId: "claude_code",
modelId: "claude-5-sonnet",
}),
["minimal", "low", "medium", "high", "xhigh", "max"],
);
// 旧世代 id 不误判。
assert.deepEqual(
settings.getChatRuntimeReasoningLevelsForProvider({
providerId: "claude_code",
modelId: "claude-3-5-sonnet-20241022",
}),
["minimal", "low", "medium", "high"],
);

assert.deepEqual(
settings.normalizeChatRuntimeControlsForProvider(
{
Expand Down Expand Up @@ -1079,6 +1122,7 @@ test("gateway settings sync keeps right dock width local and syncs project state
query: "desktop",
selectedPath: "desktop.ts",
expandedPaths: ["", "src"],
showHidden: true,
revision: 1,
stateVersion: 3,
},
Expand Down Expand Up @@ -1151,6 +1195,7 @@ test("gateway settings sync keeps right dock width local and syncs project state
query: "desktop",
selectedPath: "desktop.ts",
expandedPaths: ["", "src"],
showHidden: true,
revision: 1,
},
);
Expand Down
Loading
Loading