Skip to content
Open
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
5 changes: 4 additions & 1 deletion apps/mobile/src/components/agents/platform-filter-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Text } from '@/components/ui/text';
import { useThemeColors } from '@/lib/hooks/use-theme-colors';
import { cn } from '@/lib/utils';

const PLATFORM_FILTERS = ['cloud-agent', 'extension', 'cli', 'slack', 'other'] as const;
const PLATFORM_FILTERS = ['cloud-agent', 'extension', 'gastown', 'cli', 'slack', 'other'] as const;
const chipScrollContentStyle = { paddingHorizontal: 22, paddingVertical: 8, gap: 8 };

export type ProjectFilterOption = {
Expand Down Expand Up @@ -57,6 +57,9 @@ function platformFilterLabel(p: string): string {
case 'other': {
return 'Other';
}
case 'gastown': {
return 'Gastown';
}
default: {
return p;
}
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/components/cloud-agent-next/ChatSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function SessionRow({
);
}

const PLATFORM_FILTERS = ['cloud-agent', 'extension', 'cli', 'slack', 'other'] as const;
const PLATFORM_FILTERS = ['cloud-agent', 'extension', 'gastown', 'cli', 'slack', 'other'] as const;

function platformFilterLabel(p: string): string {
switch (p) {
Expand All @@ -284,6 +284,8 @@ function platformFilterLabel(p: string): string {
return 'Slack';
case 'other':
return 'Other';
case 'gastown':
return 'Gastown';
default:
return p;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export function CloudSidebarLayout({ organizationId, children }: CloudSidebarLay
if (platformFilter.length === 0) return undefined;
return platformFilter.flatMap(p => {
switch (p) {
// 'cloud-agent-web' is a variant of the cloud agent
case 'cloud-agent':
return ['cloud-agent', 'cloud-agent-web'];
// Extension sessions are created from VS Code or agent-manager
case 'extension':
return ['vscode', 'agent-manager'];
default:
// Handles platforms like 'gastown' by passing through unchanged
return [p];
}
});
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.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ catalog:

minimumReleaseAge: 6842
minimumReleaseAgeExclude:
- '@kilocode/*'
- tsx
- expo-dev-client
- expo-dev-launcher
Expand Down
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
10 changes: 9 additions & 1 deletion services/gastown/container/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,17 @@ export const GastownPlugin: Plugin = async ({ client }) => {
// Best-effort logging — never let telemetry failures break tool execution
async function log(level: 'info' | 'error', message: string) {
console.log(`${SERVICE} ${level}: ${message}`);
const townId = process.env.GASTOWN_TOWN_ID;

try {
await client.app.log({ body: { service: SERVICE, level, message } });
await client.app.log({
body: {
service: SERVICE,
level,
message,
...(townId ? { extra: { townId } } : {}),
},
});
} catch {
// Swallow — logging is non-critical
}
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