diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 76add6a63c2..8ba4757328f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -59,6 +59,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup pnpm uses: pnpm/action-setup@v4 @@ -72,7 +74,14 @@ jobs: cache: pnpm - name: Install dependencies - run: pnpm install --frozen-lockfile + run: | + changed="$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}")" + manifest_pattern='(^|/)package\.json$|^pnpm-workspace\.yaml$|^\.npmrc$|^pnpmfile\.(cjs|js|mjs)$' + if printf '%s\n' "$changed" | grep -Eq "$manifest_pattern"; then + pnpm install --no-frozen-lockfile + else + pnpm install --frozen-lockfile + fi - name: Typecheck run: pnpm -r typecheck @@ -97,6 +106,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup pnpm uses: pnpm/action-setup@v4 @@ -110,7 +121,14 @@ jobs: cache: pnpm - name: Install dependencies - run: pnpm install --frozen-lockfile + run: | + changed="$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}")" + manifest_pattern='(^|/)package\.json$|^pnpm-workspace\.yaml$|^\.npmrc$|^pnpmfile\.(cjs|js|mjs)$' + if printf '%s\n' "$changed" | grep -Eq "$manifest_pattern"; then + pnpm install --no-frozen-lockfile + else + pnpm install --frozen-lockfile + fi - name: Build run: pnpm build diff --git a/packages/db/src/migrations/0073_shiny_salo.sql b/packages/db/src/migrations/0073_shiny_salo.sql index affbdf6787e..473535c01bd 100644 --- a/packages/db/src/migrations/0073_shiny_salo.sql +++ b/packages/db/src/migrations/0073_shiny_salo.sql @@ -1 +1 @@ -ALTER TABLE "companies" ADD COLUMN "attachment_max_bytes" integer DEFAULT 1073741824 NOT NULL; \ No newline at end of file +ALTER TABLE "companies" ADD COLUMN "attachment_max_bytes" integer DEFAULT 10485760 NOT NULL; diff --git a/packages/db/src/migrations/meta/0073_snapshot.json b/packages/db/src/migrations/meta/0073_snapshot.json index d11b6555cc9..b38b66b4b0b 100644 --- a/packages/db/src/migrations/meta/0073_snapshot.json +++ b/packages/db/src/migrations/meta/0073_snapshot.json @@ -2965,7 +2965,7 @@ "type": "integer", "primaryKey": false, "notNull": true, - "default": 1073741824 + "default": 10485760 }, "require_board_approval_for_new_agents": { "name": "require_board_approval_for_new_agents", @@ -15856,4 +15856,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/packages/db/src/migrations/meta/0074_snapshot.json b/packages/db/src/migrations/meta/0074_snapshot.json index e0faa75cb75..1c1e22d26bb 100644 --- a/packages/db/src/migrations/meta/0074_snapshot.json +++ b/packages/db/src/migrations/meta/0074_snapshot.json @@ -2965,7 +2965,7 @@ "type": "integer", "primaryKey": false, "notNull": true, - "default": 1073741824 + "default": 10485760 }, "require_board_approval_for_new_agents": { "name": "require_board_approval_for_new_agents", @@ -15884,4 +15884,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/packages/db/src/schema/companies.ts b/packages/db/src/schema/companies.ts index 1617a735d0e..d66b330173e 100644 --- a/packages/db/src/schema/companies.ts +++ b/packages/db/src/schema/companies.ts @@ -15,7 +15,7 @@ export const companies = pgTable( spentMonthlyCents: integer("spent_monthly_cents").notNull().default(0), attachmentMaxBytes: integer("attachment_max_bytes") .notNull() - .default(1024 * 1024 * 1024), + .default(10 * 1024 * 1024), requireBoardApprovalForNewAgents: boolean("require_board_approval_for_new_agents") .notNull() .default(false), diff --git a/packages/shared/src/constants.ts b/packages/shared/src/constants.ts index 84ca86cac39..393e4d313c3 100644 --- a/packages/shared/src/constants.ts +++ b/packages/shared/src/constants.ts @@ -1,7 +1,7 @@ export const COMPANY_STATUSES = ["active", "paused", "archived"] as const; export type CompanyStatus = (typeof COMPANY_STATUSES)[number]; -export const DEFAULT_COMPANY_ATTACHMENT_MAX_BYTES = 1024 * 1024 * 1024; +export const DEFAULT_COMPANY_ATTACHMENT_MAX_BYTES = 10 * 1024 * 1024; export const MAX_COMPANY_ATTACHMENT_MAX_BYTES = 1024 * 1024 * 1024; export const DEPLOYMENT_MODES = ["local_trusted", "authenticated"] as const; diff --git a/server/src/services/issue-tree-control.ts b/server/src/services/issue-tree-control.ts index 37c45683604..ba3a07a54d7 100644 --- a/server/src/services/issue-tree-control.ts +++ b/server/src/services/issue-tree-control.ts @@ -71,6 +71,7 @@ type RestoreTreeStatusResult = TreeStatusUpdateResult & { const TERMINAL_ISSUE_STATUSES = new Set(["done", "cancelled"]); const ACTIVE_RUN_STATUSES = ["queued", "running"] as const; const DEFAULT_RELEASE_POLICY: IssueTreeHoldReleasePolicy = { strategy: "manual" }; +const MAX_PAUSE_HOLD_ANCESTOR_DEPTH = 100; export const ISSUE_TREE_CONTROL_INTERACTION_WAKE_REASONS: ReadonlySet = new Set([ "issue_commented", "issue_reopened_via_comment", @@ -589,7 +590,11 @@ export function issueTreeControlService(db: Db) { let currentIssueId: string | null = issueId; const visited = new Set(); - while (currentIssueId && !visited.has(currentIssueId)) { + while ( + currentIssueId + && !visited.has(currentIssueId) + && visited.size < MAX_PAUSE_HOLD_ANCESTOR_DEPTH + ) { visited.add(currentIssueId); const hold = holdByRootIssueId.get(currentIssueId); if (hold) { diff --git a/server/src/services/recovery/service.ts b/server/src/services/recovery/service.ts index f544f4085fa..fc9fb7e1f64 100644 --- a/server/src/services/recovery/service.ts +++ b/server/src/services/recovery/service.ts @@ -345,7 +345,7 @@ export function recoveryService(db: Db, deps: { enqueueWakeup: RecoveryWakeup }) .where( and( eq(agentWakeupRequests.companyId, companyId), - eq(agentWakeupRequests.status, "deferred_issue_execution"), + eq(agentWakeupRequests.status, "deferred_issue_execution"), sql`${agentWakeupRequests.payload} ->> 'issueId' = ${issueId}`, ), ) diff --git a/ui/src/components/IssueChatThread.tsx b/ui/src/components/IssueChatThread.tsx index 16ecd53db83..0cf7a4390b2 100644 --- a/ui/src/components/IssueChatThread.tsx +++ b/ui/src/components/IssueChatThread.tsx @@ -214,14 +214,15 @@ function useLiveElapsed(startMs: number | null | undefined, active: boolean): st function useStableEvent unknown>(callback: T | undefined): T | undefined { const callbackRef = useRef(callback); + const hasCallback = callback !== undefined; useLayoutEffect(() => { callbackRef.current = callback; }, [callback]); return useMemo(() => { - if (!callback) return undefined; + if (!hasCallback) return undefined; return ((...args: Parameters) => callbackRef.current?.(...args)) as T; - }, [Boolean(callback)]); + }, [hasCallback]); } interface CommentReassignment {