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
94 changes: 0 additions & 94 deletions apps/api/src/lib/errors.ts

This file was deleted.

12 changes: 1 addition & 11 deletions apps/api/src/routes/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Hono } from 'hono';
import * as schema from '../db/schema';
import type { Env } from '../env';
import { log } from '../lib/logger';
import { requireRouteParam } from '../lib/route-helpers';
import { getUserId, requireApproved,requireAuth } from '../middleware/auth';
import { errors } from '../middleware/error';
import { requireOwnedProject } from '../middleware/project-auth';
Expand All @@ -25,17 +26,6 @@ import { isTaskStatus } from '../services/task-status';

const chatRoutes = new Hono<{ Bindings: Env }>();

function requireRouteParam(
c: { req: { param: (name: string) => string | undefined } },
name: string
): string {
const value = c.req.param(name);
if (!value) {
throw errors.badRequest(`${name} is required`);
}
return value;
}

chatRoutes.use('/*', requireAuth(), requireApproved());

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routes/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ nodesRoutes.post('/:id/stop', async (c) => {
.where(inArray(schema.agentSessions.workspaceId, workspaceIds));
}

return c.json({ status: 'deleted' });
return c.json({ status: 'stopped' });
});

nodesRoutes.delete('/:id', async (c) => {
Expand Down
8 changes: 5 additions & 3 deletions apps/api/src/routes/tasks/_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,16 @@ export async function setTaskStatus(
errorMessage: toStatus === 'failed' ? (options.errorMessage?.trim() || 'Task failed') : null,
})
.where(eq(schema.triggerExecutions.id, updatedTask.triggerExecutionId))
.catch((err) => {
.catch((err: unknown) => {
// Best-effort — don't fail the task status update if execution sync fails
// eslint-disable-next-line no-console
console.error('trigger_execution_sync_failed', {
console.error(JSON.stringify({
level: 'error',
event: 'trigger_execution_sync_failed',
taskId: task.id,
triggerExecutionId: updatedTask.triggerExecutionId,
error: String(err),
});
}));
});
}

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/pages/CreateWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export function CreateWorkspace() {
setBranchesError('Could not fetch branches, showing common defaults');
}
} catch (err) {
console.log('Could not fetch branches:', err);
console.error('Could not fetch branches:', err);
// Provide common branch names as fallback
setBranches([{ name: 'main' }, { name: 'master' }, { name: 'develop' }]);
setBranchesError('Unable to fetch branches. Common branch names provided.');
Expand Down
11 changes: 11 additions & 0 deletions packages/providers/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,15 @@ export class ProviderError extends Error {
) {
super(message, options);
}

/** Make Error properties visible to JSON.stringify */
toJSON(): Record<string, unknown> {
return {
name: this.name,
message: this.message,
provider: this.providerName,
statusCode: this.statusCode,
cause: this.cause instanceof Error ? this.cause.message : this.cause,
};
}
}
14 changes: 0 additions & 14 deletions scripts/deploy/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,6 @@ export interface MigrationStatus {
lastRun?: string;
}

export interface DeploymentState {
version: string;
environment: string;
timestamp: string;
status: DeploymentStatus;
resources: ProvisionedResources;
dnsRecords: DnsRecord[];
steps: DeploymentStep[];
secretsConfigured: string[];
migrations: MigrationStatus;
}

// ============================================================================
// Preflight Check Types
// ============================================================================
Expand Down Expand Up @@ -314,8 +302,6 @@ export interface CloudflareWorker {
// Constants
// ============================================================================

export const DEPLOYMENT_STATE_VERSION = '1.0.0';

// Note: Resource naming is centralized in config.ts (DEPLOYMENT_CONFIG.resources)
// Do NOT add resource naming constants here - use DEPLOYMENT_CONFIG instead.

Expand Down
Loading