Skip to content

Commit 8cad0ee

Browse files
committed
Fix review-agent findings
1 parent 17636d9 commit 8cad0ee

File tree

10 files changed

+33
-13
lines changed

10 files changed

+33
-13
lines changed

apps/macos/Packages/Features/DashboardFeature/Sources/DashboardFeature/ProjectDetailView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,10 @@ struct ProjectDetailView: View {
446446

447447
private var runtimeServicesByName: [String: RuntimeService] {
448448
guard let runtime = project.runtime else { return [:] }
449-
return Dictionary(uniqueKeysWithValues: runtime.services.map { ($0.service, $0) })
449+
return Dictionary(
450+
runtime.services.map { ($0.service, $0) },
451+
uniquingKeysWith: { first, _ in first }
452+
)
450453
}
451454

452455
private var serviceHostsByName: [String: [String]] {

apps/macos/Packages/Features/DashboardFeature/Sources/DashboardFeature/ProjectInspectorColumn.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,10 @@ struct ProjectInspectorColumn: View {
783783

784784
private var runtimeServicesByName: [String: RuntimeService] {
785785
guard let runtime = project.runtime else { return [:] }
786-
return Dictionary(uniqueKeysWithValues: runtime.services.map { ($0.service, $0) })
786+
return Dictionary(
787+
runtime.services.map { ($0.service, $0) },
788+
uniquingKeysWith: { first, _ in first }
789+
)
787790
}
788791

789792
private var serviceHostsByName: [String: [String]] {

docs/gateway-api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,10 @@ Non-JSON text frames are treated as raw input.
548548
| `status` | string | Human-readable status |
549549
| `name` | string | Container name |
550550
| `ports` | string | Port mapping string |
551+
| `image` | string or null | Container image |
552+
| `ip` | string or null | Container IP address |
553+
| `mounts` | RuntimeMount[] | Volume/bind mounts |
554+
| `labels` | object | Container labels |
551555
| `working_dir` | string or null | Compose working directory |
552556

553557
### PsItem

src/commands/global.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,7 @@ function removeLegacyDnsmasqLines(opts: {
19561956
if (!updated.includes(legacyLine)) {
19571957
continue;
19581958
}
1959-
updated = updated.replace(legacyLine, "");
1959+
updated = updated.replaceAll(legacyLine, "");
19601960
changed = true;
19611961
}
19621962

src/commands/ssh.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ async function handleSsh(opts: {
147147
const sessionArg = args.positionals.session;
148148

149149
if (sessionArg) {
150+
if (!SESSION_NAME_PATTERN.test(sessionArg)) {
151+
p.log.error(
152+
"Invalid session name (only letters, numbers, dashes, underscores, or dots)"
153+
);
154+
return 1;
155+
}
150156
// Direct connect to specified session
151157
return await connectToSession({
152158
hostname,

src/commands/usage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ function resolveHostProcessKind(opts: {
540540
return "hack tui";
541541
}
542542
if (normalized.includes(" hack remote")) {
543-
return "hack tui";
543+
return "hack remote";
544544
}
545545
if (normalized.includes(" hack logs")) {
546546
return "log-stream";

src/control-plane/extensions/supervisor/shell-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ function buildShellEnv(opts: {
368368
env[key] = value;
369369
}
370370
}
371-
env.TERM = process.env.TERM ?? DEFAULT_TERM;
371+
env.TERM = env.TERM || process.env.TERM || DEFAULT_TERM;
372372
return env;
373373
}
374374

src/daemon/routes/sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ function parseSessionCreateInput(
389389
return { ok: false, error: "missing_name" };
390390
}
391391

392-
// Validate session name (tmux restrictions)
392+
// Validate session name (alphanumeric, dash, underscore, dot)
393393
const trimmedName = name.trim();
394394
if (!SESSION_NAME_PATTERN.test(trimmedName)) {
395395
return {

src/daemon/runtime-cache.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,16 @@ export function createRuntimeCache(opts: {
223223
if (!reg) {
224224
return null;
225225
}
226-
return await resolveProjectMeta({
227-
projectName: reg.name,
228-
repoRoot: reg.repoRoot,
229-
projectDir: reg.projectDir,
230-
composeFile: resolve(reg.projectDir, PROJECT_COMPOSE_FILENAME),
231-
});
226+
try {
227+
return await resolveProjectMeta({
228+
projectName: reg.name,
229+
repoRoot: reg.repoRoot,
230+
projectDir: reg.projectDir,
231+
composeFile: resolve(reg.projectDir, PROJECT_COMPOSE_FILENAME),
232+
});
233+
} catch {
234+
return null;
235+
}
232236
})
233237
)
234238
: [];

tests/daemon-env.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe("handleEnvRoutes", () => {
9292
if (originalConfigPath !== undefined) {
9393
process.env.HACK_GLOBAL_CONFIG_PATH = originalConfigPath;
9494
} else {
95-
process.env.HACK_GLOBAL_CONFIG_PATH = undefined;
95+
Reflect.deleteProperty(process.env, "HACK_GLOBAL_CONFIG_PATH");
9696
}
9797
await rm(tempDir, { recursive: true, force: true });
9898
});

0 commit comments

Comments
 (0)