Skip to content
Closed
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
41 changes: 24 additions & 17 deletions apps/web/src/components/cloud-agent-next/SessionsList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Bot, Clock, Cloud, GitBranch, Puzzle, Terminal } from 'lucide-react';
import { Bot, Clock, Cloud, GitBranch, Puzzle, Terminal, Workflow } from 'lucide-react';
import type { StoredSession } from './types';
import { TimeAgo } from '@/components/shared/TimeAgo';
import Link from 'next/link';
Expand Down Expand Up @@ -69,22 +69,29 @@ export function SessionsList({ sessions, organizationId, onSessionClick }: Sessi
Agent Manager
</span>
);
} else if (platform === 'slack') {
badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-emerald-500/20 px-2 py-0.5 text-xs font-medium text-emerald-400">
<Bot className="h-3 w-3" />
Slack
</span>
);
} else {
// Default to Extension badge for unknown, vscode, etc.
badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-purple-500/20 px-2 py-0.5 text-xs font-medium text-purple-400">
<Puzzle className="h-3 w-3" />
Extension
</span>
);
}
} else if (platform === 'slack') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Indentation is broken — } else if (platform === 'slack') { is at column 0 instead of matching the surrounding else if branches (8 spaces). This same pattern repeats in apps/web/src/components/cloud-agent/SessionsList.tsx line 74. The code is syntactically correct (React renders fine) but is visually inconsistent and will be a diff noise issue in future PRs.

badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-emerald-500/20 px-2 py-0.5 text-xs font-medium text-emerald-400">
<Bot className="h-3 w-3" />
Slack
</span>
);
} else if (platform === 'gastown') {
badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-amber-500/20 px-2 py-0.5 text-xs font-medium text-amber-400">
<Workflow className="h-3 w-3" />
Gastown
</span>
);
} else {
// Default to Extension badge for unknown, vscode, etc.
badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-purple-500/20 px-2 py-0.5 text-xs font-medium text-purple-400">
<Puzzle className="h-3 w-3" />
Extension
</span>
);
}

const cardContent = (
<Card className="hover:bg-accent cursor-pointer transition-colors">
Expand Down
41 changes: 24 additions & 17 deletions apps/web/src/components/cloud-agent/SessionsList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Bot, Clock, Cloud, GitBranch, Puzzle, Terminal } from 'lucide-react';
import { Bot, Clock, Cloud, GitBranch, Puzzle, Terminal, Workflow } from 'lucide-react';
import type { StoredSession } from './types';
import { formatDistanceToNow } from 'date-fns';
import Link from 'next/link';
Expand Down Expand Up @@ -71,22 +71,29 @@ export function SessionsList<T extends SessionsListItem>({
Agent Manager
</span>
);
} else if (platform === 'slack') {
badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-emerald-500/20 px-2 py-0.5 text-xs font-medium text-emerald-400">
<Bot className="h-3 w-3" />
Slack
</span>
);
} else {
// Default to Extension badge for unknown, vscode, etc.
badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-purple-500/20 px-2 py-0.5 text-xs font-medium text-purple-400">
<Puzzle className="h-3 w-3" />
Extension
</span>
);
}
} else if (platform === 'slack') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Same indentation issue as in cloud-agent-next/SessionsList.tsx} else if (platform === 'slack') { starts at column 0 instead of being indented to match the surrounding else if blocks.

badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-emerald-500/20 px-2 py-0.5 text-xs font-medium text-emerald-400">
<Bot className="h-3 w-3" />
Slack
</span>
);
} else if (platform === 'gastown') {
badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-amber-500/20 px-2 py-0.5 text-xs font-medium text-amber-400">
<Workflow className="h-3 w-3" />
Gastown
</span>
);
} else {
// Default to Extension badge for unknown, vscode, etc.
badge = (
<span className="inline-flex shrink-0 items-center gap-1 rounded bg-purple-500/20 px-2 py-0.5 text-xs font-medium text-purple-400">
<Puzzle className="h-3 w-3" />
Extension
</span>
);
}

const cardContent = (
<Card className="hover:bg-accent cursor-pointer transition-colors">
Expand Down
83 changes: 74 additions & 9 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion services/gastown/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ RUN git lfs install --system
# Install both glibc and musl variants — the CLI's binary resolver may
# pick either depending on the detected libc.
# Also install pnpm — many projects use it as their package manager.
RUN npm install -g @kilocode/cli@7.2.14 @kilocode/cli-linux-x64@7.2.14 @kilocode/cli-linux-x64-musl@7.2.14 @kilocode/plugin@7.2.14 pnpm && \
RUN npm install -g @kilocode/cli@7.3.1 @kilocode/cli-linux-x64@7.3.1 @kilocode/cli-linux-x64-musl@7.3.1 @kilocode/plugin@7.3.1 pnpm && \
ln -s "$(which kilo)" /usr/local/bin/opencode

# Create non-root user for defense-in-depth
Expand Down
2 changes: 1 addition & 1 deletion services/gastown/container/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ RUN git lfs install --system
# pick either depending on the detected libc. bun:1-slim is Debian (glibc)
# but the resolver sometimes misdetects; installing both is safe.
# Also install pnpm — many projects use it as their package manager.
RUN npm install -g @kilocode/cli@7.2.14 @kilocode/cli-linux-arm64@7.2.14 @kilocode/cli-linux-arm64-musl@7.2.14 @kilocode/plugin@7.2.14 pnpm && \
RUN npm install -g @kilocode/cli@7.3.1 @kilocode/cli-linux-arm64@7.3.1 @kilocode/cli-linux-arm64-musl@7.3.1 @kilocode/plugin@7.3.1 pnpm && \
ln -s "$(which kilo)" /usr/local/bin/opencode

# Create non-root user for defense-in-depth
Expand Down
2 changes: 1 addition & 1 deletion services/gastown/container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@kilocode/plugin": "7.2.52",
"@kilocode/sdk": "7.2.14",
"@kilocode/sdk": "7.3.1",
"hono": "catalog:",
"zod": "catalog:"
},
Expand Down
43 changes: 42 additions & 1 deletion services/gastown/container/src/agent-runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ vi.mock('./logger', () => ({
log: { info: vi.fn() },
}));

import { buildAgentEnv, buildKiloConfigContent } from './agent-runner';
import { buildAgentEnv, buildKiloAuthEnv, buildKiloConfigContent } from './agent-runner';
import type { StartAgentRequest } from './types';

function baseRequest(overrides: Partial<StartAgentRequest> = {}): StartAgentRequest {
Expand Down Expand Up @@ -117,3 +117,44 @@ describe('buildKiloConfigContent', () => {
expect(parsed.provider.kilo.options.kilocodeOrganizationId).toBeUndefined();
});
});

describe('buildKiloAuthEnv', () => {
it('sets KILO_PLATFORM to gastown', () => {
const env = buildKiloAuthEnv(undefined, undefined);
expect(env.KILO_PLATFORM).toBe('gastown');
});

it('sets KILO_AUTH_CONTENT when kilocodeToken is provided', () => {
const env = buildKiloAuthEnv('tok-abc', undefined);
expect(env.KILO_AUTH_CONTENT).toBe(JSON.stringify({ kilo: { type: 'api', key: 'tok-abc' } }));
});

it('omits KILO_AUTH_CONTENT when kilocodeToken is absent', () => {
const env = buildKiloAuthEnv(undefined, undefined);
expect(env.KILO_AUTH_CONTENT).toBeUndefined();
});

it('sets KILO_ORG_ID when organizationId is provided', () => {
const env = buildKiloAuthEnv('tok', 'org-123');
expect(env.KILO_ORG_ID).toBe('org-123');
});

it('omits KILO_ORG_ID when organizationId is null', () => {
const env = buildKiloAuthEnv('tok', null);
expect(env.KILO_ORG_ID).toBeUndefined();
});

it('omits KILO_ORG_ID when organizationId is undefined', () => {
const env = buildKiloAuthEnv('tok', undefined);
expect(env.KILO_ORG_ID).toBeUndefined();
});

it('sets all three env vars when both inputs are provided', () => {
const env = buildKiloAuthEnv('tok-full', 'org-full');
expect(env).toEqual({
KILO_PLATFORM: 'gastown',
KILO_AUTH_CONTENT: JSON.stringify({ kilo: { type: 'api', key: 'tok-full' } }),
KILO_ORG_ID: 'org-full',
});
});
});
Loading
Loading