mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-03 20:09:33 +01:00
## Thinking Path > - Paperclip schedules work for agents. > - Each agent has a limit on simultaneous runs. > - A task driver can provide an execution environment with its own capacity. > - Previously the creation form sent the same limit for every driver. > - A driver can now declare the value Core saves when a new agent has no explicit limit. ## Linked Issues or Issue Description **Subsystem affected** Agent hiring and plugin environment drivers. **Current behavior** The create form, API, and import flow supply the global concurrency default before the task driver can provide one. **Proposed behavior** Let each task driver declare an optional per-agent concurrency default. Apply it once during hire and honor explicit agent limits. ## What Changed - Refreshed the three SDK source pins for the changed files. - Added the optional driver field `defaultMaxConcurrentRuns` with integer bounds from 1 through 50. - Applied it during hire using the resolved task environment. Saved the resolved runtime configuration in hire approvals. - Removed early defaults from the creation form, routes and new-agent imports. Preserved saved limits on export, including explicit values equal to the global default. Kept the current limit when importing an update with an omitted limit. ## Verification - [Full PR CI](https://github.com/paperclipai/paperclip/actions/runs/47000023360) passed on `83cce42b9a`. Server shard 16 passed on retry after a PostgreSQL connection reset on the first attempt. - `pnpm -r typecheck` passed. The SDK source pin check passed. `pnpm verify` selected broad CI coverage because the SDK input registry changed. - On rebased commit `83cce42b9a`, all 441 tests in six focused Vitest suites passed, including the MCP rollback test corrected in #23560. The SDK source pin check passed. ## Risks This affects new hires on drivers that opt in. Existing agents retain their saved configuration. Single-run provider limits still apply. An older client that explicitly sends the global default will keep that value. ## Model Used OpenAI GPT-6 via Codex. Used local source inspection, code editing, TypeScript and test execution. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>
30 lines
922 B
TypeScript
30 lines
922 B
TypeScript
import { defaultCreateValues } from "../components/agent-config-defaults";
|
|
|
|
export function buildNewAgentRuntimeConfig(input?: {
|
|
heartbeatEnabled?: boolean;
|
|
intervalSec?: number;
|
|
}): Record<string, unknown> {
|
|
const config: Record<string, unknown> = {
|
|
heartbeat: {
|
|
enabled: input?.heartbeatEnabled ?? defaultCreateValues.heartbeatEnabled,
|
|
intervalSec: input?.intervalSec ?? defaultCreateValues.intervalSec,
|
|
wakeOnDemand: true,
|
|
skipTimerWhenNoActionableWork: true,
|
|
cooldownSec: 10,
|
|
},
|
|
};
|
|
|
|
return config;
|
|
}
|
|
|
|
export function buildOnboardingAgentRuntimeConfig(
|
|
savedRuntimeConfig: Record<string, unknown> = {},
|
|
options?: { preserveExisting?: boolean },
|
|
): Record<string, unknown> {
|
|
const { aiConnection: _savedBinding, ...runtimeConfig } = savedRuntimeConfig;
|
|
return {
|
|
...runtimeConfig,
|
|
...(!options?.preserveExisting ? buildNewAgentRuntimeConfig() : {}),
|
|
};
|
|
}
|