feat(ui): improve task composer controls and pending input (#14322)

## Thinking Path

> - Paperclip lets operators assign tasks to AI agents and review their
work.
> - The task composer controls the next message and its assigned agent.
> - Operators needed a way to choose that agent's model and effort
without leaving the composer.
> - The old mode selector, upload button, and input cards made the
mobile composer crowded and hid normal messaging during a pending
decision.
> - Harnesses publish different model and effort capabilities, so the
picker must follow the selected agent.
> - This pull request adds one responsive composer flow, keeps pending
cards visible above it, and protects Codex ACP authentication in the
local test path.
> - Operators can choose run settings, send a message, and answer a
pending card as separate actions.

## Linked Issues or Issue Description

**Subsystem affected**

Task composer UI, issue thread interactions, Codex ACP credential
handling, and Storybook.

**Problem or motivation**

The composer did not expose model or effort for the selected agent.
Mobile actions wrapped poorly. Pending questions and confirmations
replaced the composer. A local Codex ACP test could also reuse host
authentication after the managed key was removed.

**Proposed solution**

Put assignee search, model search, exact model IDs, effort, and fast
mode in one picker. Use a mobile dialog. Replace the direct-upload plus
action and separate mode selector with an Add menu and removable Plan or
Ask chips. Place pending interaction cards above the usable composer.
Keep these cards pending after an ordinary message unless their creator
asks for comment superseding. Replace managed ACP auth files atomically
and isolate the test key from host credentials.

**Roadmap alignment**

ROADMAP.md does not list an overlapping composer milestone. This change
improves the existing task and review flows.

## What Changed

- Added the combined assignee, model, and effort picker to both task
composers. Search matches agent name, role, and harness. The server uses
a curated Codex list by default and honors instance-declared models.
Manual IDs remain available.
- Added an effort slider for known model capabilities, a conditional
Codex fast control, and reset. The picker opens in a modal on mobile.
- Added the Add menu for files, supported goals, Plan mode, and Ask
mode. Plan and Ask are exclusive removable chips. Keyboard mode cycling
remains available.
- Adjusted mobile spacing, avatars, wrapping, and Send placement.
Removed the composer divider.
- Moved pending question, confirmation, review, and related cards above
the composer. Ordinary comments now leave question and confirmation
cards pending by default. The onboarding prompt retains explicit comment
superseding.
- Updated the Storybook composer group with responsive states and the
production picker. Added UI, service, route, and browser regression
coverage.
- Isolated Codex ACP API-key authentication, skipped subscription auth
merge and shared-home copy-back for remote API-key runs, and replaced
the managed auth file atomically.

## Verification

- `pnpm -r typecheck` — passed on the final local head.
- `pnpm check:token-gates` — passed on the final local head.
- `pnpm exec vitest run server/src/__tests__/adapter-models.test.ts
ui/src/components/task-chat/ComposerRunSettingsPicker.test.tsx` — 31
tests passed, including role and harness search, declared Codex models,
and filtering general OpenAI models.
- `pnpm exec vitest run
server/src/__tests__/issue-thread-interactions-service.test.ts` — 74
tests passed.
- `pnpm exec vitest run
packages/adapters/codex-local/src/server/acp.test.ts` — 42 tests passed,
including remote API-key copy-back isolation.
- `pnpm test:run` — attempted locally; the embedded PostgreSQL test
database could not initialize on macOS. The isolated
`heartbeat-run-event-sequencing` suite reproduced that environment
failure. GitHub CI runs the full test matrix for this head.
- `pnpm build` — passed on the final head. `pnpm build-storybook` passed
after the last UI change; only server code, tests, and docs changed
afterward.
- Live local test drive — Codex ACP ran a task with a managed API key.
The test agent was restored to its default ACP configuration afterward.
- Review the interactive stories under the top-level Composer group with
`pnpm storybook`. Check a narrow desktop width and mobile Plan, Ask,
picker, and pending-question states.

## Risks

- A pending card stays open when an ordinary comment changes the
discussion. Its creator can set `supersedeOnUserComment: true` when a
new comment should replace it.
- Model and effort overrides persist on the task until reset or changed.
An unlisted manual model ID may fail when the provider runs it.
- Some harness catalogs do not report effort support. The picker hides
effort for those models.
- No database migration is required.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

OpenAI GPT-6 via Codex. This runtime does not expose the exact model ID
or context window to the task. The model used code execution and browser
tools.

## 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
- [ ] 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>
Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
authored and GitHub committed 2026-09-28 23:02:39 +00:00
1 parent 24c58e479a
commit 0be2afcca6
62 files changed
+3436 -716

No files matched your search

+51 -28
View File
@@ -5,7 +5,7 @@ import { models as codexFallbackModels } from "@paperclipai/adapter-codex-local"
import { models as cursorFallbackModels } from "@paperclipai/adapter-cursor-local";
import { models as opencodeFallbackModels } from "@paperclipai/adapter-opencode-local";
import { resetOpenCodeModelsCacheForTests } from "@paperclipai/adapter-opencode-local/server";
import { listAdapterModels, listServerAdapters, refreshAdapterModels } from "../adapters/index.js";
import { listAdapterModels, listServerAdapters, refreshAdapterModels, registerServerAdapter, unregisterServerAdapter } from "../adapters/index.js";
import { resetCodexModelsCacheForTests } from "../adapters/codex-models.js";
import { resetCursorModelsCacheForTests, setCursorModelsRunnerForTests } from "../adapters/cursor-models.js";
@@ -195,14 +195,14 @@ describe("adapter model listing", () => {
]));
});
it("loads codex models dynamically and merges fallback options", async () => {
it("keeps general OpenAI API models out of the Codex catalog", async () => {
process.env.OPENAI_API_KEY = "sk-test";
const fetchSpy = vi.spyOn(globalThis, "fetch").mockResolvedValue({
ok: true,
json: async () => ({
data: [
{ id: "gpt-5-pro" },
{ id: "gpt-5" },
{ id: "gpt-image-1" },
{ id: "text-embedding-3-large" },
],
}),
} as Response);
@@ -210,40 +210,26 @@ describe("adapter model listing", () => {
const first = await listAdapterModels("codex_local");
const second = await listAdapterModels("codex_local");
expect(fetchSpy).toHaveBeenCalledTimes(1);
expect(first).toEqual(second);
expect(first.some((model) => model.id === "gpt-5-pro")).toBe(true);
expect(first.some((model) => model.id === "codex-mini-latest")).toBe(true);
expect(fetchSpy).not.toHaveBeenCalled();
expect(first).toEqual(codexFallbackModels);
expect(second).toEqual(codexFallbackModels);
});
it("refreshes cached codex models on demand", async () => {
it("keeps the curated Codex list when refreshing with an OpenAI key", async () => {
process.env.OPENAI_API_KEY = "sk-test";
const fetchSpy = vi.spyOn(globalThis, "fetch")
.mockResolvedValueOnce({
ok: true,
json: async () => ({
data: [{ id: "gpt-5" }],
}),
} as Response)
.mockResolvedValueOnce({
ok: true,
json: async () => ({
data: [{ id: "gpt-5.6-terra" }],
}),
} as Response);
const fetchSpy = vi.spyOn(globalThis, "fetch");
const initial = await listAdapterModels("codex_local");
const refreshed = await refreshAdapterModels("codex_local");
expect(fetchSpy).toHaveBeenCalledTimes(2);
expect(initial.some((model) => model.id === "gpt-5")).toBe(true);
expect(refreshed.some((model) => model.id === "gpt-5.6-terra")).toBe(true);
expect(refreshed.some((model) => model.id === "gpt-5.6-luna")).toBe(true);
expect(fetchSpy).not.toHaveBeenCalled();
expect(initial).toEqual(codexFallbackModels);
expect(refreshed).toEqual(codexFallbackModels);
});
it("falls back to static codex models when OpenAI model discovery fails", async () => {
it("uses static Codex models without calling OpenAI model discovery", async () => {
process.env.OPENAI_API_KEY = "sk-test";
vi.spyOn(globalThis, "fetch").mockResolvedValue({
const fetchSpy = vi.spyOn(globalThis, "fetch").mockResolvedValue({
ok: false,
status: 401,
json: async () => ({}),
@@ -251,6 +237,33 @@ describe("adapter model listing", () => {
const models = await listAdapterModels("codex_local");
expect(models).toEqual(codexFallbackModels);
expect(fetchSpy).not.toHaveBeenCalled();
});
it("uses a custom Codex adapter's model and refresh hooks", async () => {
const builtin = listServerAdapters().find((adapter) => adapter.type === "codex_local")!;
const customModels = [{ id: "plugin-codex", label: "Plugin Codex" }];
const listModels = vi.fn(async () => customModels);
const refreshModels = vi.fn(async () => customModels);
registerServerAdapter({ ...builtin, models: [], listModels, refreshModels });
try {
await expect(listAdapterModels("codex_local")).resolves.toEqual(customModels);
await expect(refreshAdapterModels("codex_local")).resolves.toEqual(customModels);
expect(listModels).toHaveBeenCalledOnce();
expect(refreshModels).toHaveBeenCalledOnce();
process.env.PAPERCLIP_ADAPTER_MODELS = JSON.stringify({
codex_local: [{ id: "declared-codex", label: "Declared Codex" }],
});
const declared = [{ id: "declared-codex", label: "Declared Codex" }];
await expect(listAdapterModels("codex_local")).resolves.toEqual(declared);
await expect(refreshAdapterModels("codex_local")).resolves.toEqual(declared);
expect(listModels).toHaveBeenCalledOnce();
expect(refreshModels).toHaveBeenCalledOnce();
} finally {
delete process.env.PAPERCLIP_ADAPTER_MODELS;
unregisterServerAdapter("codex_local");
}
});
@@ -315,6 +328,16 @@ describe("adapter model listing", () => {
]);
});
it("uses declared Codex models for both listing and refresh", async () => {
process.env.PAPERCLIP_ADAPTER_MODELS = JSON.stringify({
codex_local: [{ id: "private-codex", label: "Private Codex" }],
});
const declared = [{ id: "private-codex", label: "Private Codex" }];
await expect(listAdapterModels("codex_local")).resolves.toEqual(declared);
await expect(refreshAdapterModels("codex_local")).resolves.toEqual(declared);
});
it("observes env changes between calls (memo keyed by raw env value)", async () => {
process.env.PAPERCLIP_ADAPTER_MODELS = JSON.stringify({
opencode_local: [{ id: "model-a" }],
@@ -1009,7 +1009,11 @@ describeEmbeddedPostgres(
{ id: fixture.issueId, companyId: fixture.companyId },
{
kind: "request_confirmation",
payload: { version: 1, prompt: "Proceed with the release?" },
payload: {
version: 1,
prompt: "Proceed with the release?",
supersedeOnUserComment: true,
},
},
{ agentId: fixture.agentId },
);
@@ -1053,6 +1057,7 @@ describeEmbeddedPostgres(
kind: "ask_user_questions",
payload: {
version: 1,
supersedeOnUserComment: true,
questions: [
{
id: "priority",
@@ -394,6 +394,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
continuationPolicy: "wake_assignee",
payload: {
version: 1,
supersedeOnUserComment: true,
questions: [{
id: "scope",
prompt: "Which scope?",
@@ -1435,7 +1436,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
});
});
it("expires ask_user_questions interactions by default when a user comments after creation", async () => {
it("expires ask_user_questions when a creator opts into comment supersede", async () => {
const { companyId, issueId } = await seedConfirmationIssue("Question supersede");
const commentId = randomUUID();
@@ -1446,6 +1447,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
kind: "ask_user_questions",
payload: {
version: 1,
supersedeOnUserComment: true,
questions: [{
id: "scope",
prompt: "Choose the scope",
@@ -1491,7 +1493,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
});
});
it("keeps ask_user_questions pending when user-comment supersede is explicitly disabled", async () => {
it("keeps ask_user_questions pending by default when the user sends a message", async () => {
const { companyId, issueId } = await seedConfirmationIssue("Question supersede opt-out");
await interactionsSvc.create({
@@ -1501,7 +1503,6 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
kind: "ask_user_questions",
payload: {
version: 1,
supersedeOnUserComment: false,
questions: [{
id: "scope",
prompt: "Choose the scope",
@@ -1513,6 +1514,9 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
userId: "local-board",
});
const [created] = await db.select().from(issueThreadInteractions);
expect(created?.payload).toMatchObject({ supersedeOnUserComment: false });
const expired = await interactionsSvc.expireRequestConfirmationsSupersededByComment({
id: issueId,
companyId,
@@ -1600,6 +1604,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
kind: "ask_user_questions",
payload: {
version: 1,
supersedeOnUserComment: true,
questions: [{
id: "scope",
prompt: "Choose the scope",
@@ -2519,7 +2524,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
status: "pending",
continuationPolicy: "wake_assignee",
payload: {
supersedeOnUserComment: true,
supersedeOnUserComment: false,
allowDeclineReason: true,
},
});
@@ -2618,6 +2623,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
payload: {
version: 1,
prompt: "Which files should be deleted?",
supersedeOnUserComment: true,
options: [{ id: "file-a", label: "a.txt" }],
},
}, {
@@ -2648,6 +2654,27 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
});
});
it("keeps checkbox confirmations pending by default after a user comment", async () => {
const { companyId, issueId } = await seedConfirmationIssue("Checkbox card remains");
const created = await interactionsSvc.create({ id: issueId, companyId }, {
kind: "request_checkbox_confirmation",
payload: {
version: 1,
prompt: "Choose a file",
options: [{ id: "file-a", label: "a.txt" }],
},
}, { userId: "local-board" });
expect(created.payload.supersedeOnUserComment).toBe(false);
const expired = await interactionsSvc.expireRequestConfirmationsSupersededByComment(
{ id: issueId, companyId },
{ id: randomUUID(), createdAt: new Date(Date.now() + 1_000), authorUserId: "local-board" },
{ userId: "local-board" },
);
expect(expired).toHaveLength(0);
expect((await db.select().from(issueThreadInteractions))[0]?.status).toBe("pending");
});
it("submits request_item_verdicts partially and completes when all items are resolved", async () => {
const { companyId, issueId } = await seedConfirmationIssue("Item verdict partial submit");
@@ -2677,7 +2704,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
verdicts: ["approve", "reject"],
requireReasonOn: ["reject"],
allowBulkApprove: true,
supersedeOnUserComment: true,
supersedeOnUserComment: false,
},
});
@@ -2835,6 +2862,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
payload: {
version: 1,
prompt: "Review generated artifacts.",
supersedeOnUserComment: true,
items: [
{ id: "api", label: "API route" },
{ id: "docs", label: "Docs" },
@@ -2885,6 +2913,27 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
});
});
it("keeps item verdict requests pending by default after a user comment", async () => {
const { companyId, issueId } = await seedConfirmationIssue("Verdict card remains");
const created = await interactionsSvc.create({ id: issueId, companyId }, {
kind: "request_item_verdicts",
payload: {
version: 1,
prompt: "Review the file",
items: [{ id: "file-a", label: "a.txt" }],
},
}, { userId: "local-board" });
expect(created.payload.supersedeOnUserComment).toBe(false);
const expired = await interactionsSvc.expireRequestConfirmationsSupersededByComment(
{ id: issueId, companyId },
{ id: randomUUID(), createdAt: new Date(Date.now() + 1_000), authorUserId: "local-board" },
{ userId: "local-board" },
);
expect(expired).toHaveLength(0);
expect((await db.select().from(issueThreadInteractions))[0]?.status).toBe("pending");
});
it("returns accepted agent confirmations from review without resetting active work", async () => {
const companyId = randomUUID();
const goalId = randomUUID();
@@ -3187,7 +3236,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
.resolves.toBe("planning");
});
it("expires request confirmations by default when a user comments after creation", async () => {
it("expires request confirmations when a creator opts into comment supersede", async () => {
const { companyId, issueId } = await seedConfirmationIssue();
const commentId = randomUUID();
@@ -3199,6 +3248,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
payload: {
version: 1,
prompt: "Proceed with the current draft?",
supersedeOnUserComment: true,
},
}, {
userId: "local-board",
@@ -3234,7 +3284,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
});
});
it("keeps request confirmations pending when user-comment supersede is explicitly disabled", async () => {
it("keeps request confirmations pending by default when the user sends a message", async () => {
const { companyId, issueId } = await seedConfirmationIssue("Comment supersede opt-out");
await interactionsSvc.create({
@@ -3245,12 +3295,14 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
payload: {
version: 1,
prompt: "Proceed with the current draft?",
supersedeOnUserComment: false,
},
}, {
userId: "local-board",
});
const [created] = await db.select().from(issueThreadInteractions);
expect(created?.payload).toMatchObject({ supersedeOnUserComment: false });
const expired = await interactionsSvc.expireRequestConfirmationsSupersededByComment({
id: issueId,
companyId,
@@ -3475,6 +3527,7 @@ describeEmbeddedPostgres("issueThreadInteractionService", () => {
payload: {
version: 1,
prompt: "Proceed with the current draft?",
supersedeOnUserComment: true,
},
}, {
userId: "local-board",
@@ -438,6 +438,7 @@ describeEmbeddedPostgres("issueThreadInteractionService telemetry", () => {
continuationPolicy: "wake_assignee",
payload: {
version: 1,
supersedeOnUserComment: true,
questions: [
{
id: "scope",
@@ -563,6 +564,7 @@ describeEmbeddedPostgres("issueThreadInteractionService telemetry", () => {
payload: {
version: 1,
prompt: "Approve this plan?",
supersedeOnUserComment: true,
},
}, {
userId: "local-board",
@@ -201,7 +201,8 @@ function registerModuleMocks() {
}));
}
async function createApp() {
async function createApp(transaction: (callback: (tx: Record<string, never>) => Promise<unknown>) => Promise<unknown> =
async (callback) => callback({})) {
const [{ errorHandler }, { issueRoutes }] = await Promise.all([
vi.importActual<typeof import("../middleware/index.js")>("../middleware/index.js"),
vi.importActual<typeof import("../routes/issues.js")>("../routes/issues.js"),
@@ -220,7 +221,7 @@ async function createApp() {
next();
});
app.use("/api", issueRoutes({
transaction: async (callback: (tx: Record<string, never>) => Promise<unknown>) => callback({}),
transaction,
} as any, {} as any));
app.use(errorHandler);
return app;
@@ -330,6 +331,7 @@ describe("issue update comment wakeups", () => {
externalConversationState,
assigneeAgentId: ASSIGNEE_AGENT_ID,
assigneeUserId: null,
assigneeAdapterOverrides: { adapterConfig: { model: "gpt-6-astra", modelReasoningEffort: "ultra", fastMode: true } },
});
mockIssueService.getById.mockResolvedValue(existing);
mockIssueService.update.mockResolvedValue(updated);
@@ -347,11 +349,16 @@ describe("issue update comment wakeups", () => {
assigneeUserId: null,
comment: "write the whole thing",
commentClientRequestId: "55555555-5555-4555-8555-555555555555",
assigneeAdapterOverrides: updated.assigneeAdapterOverrides,
});
expect(res.status).toBe(200);
expect(mockIssueService.update).toHaveBeenCalledWith(existing.id, expect.objectContaining({
assigneeAdapterOverrides: updated.assigneeAdapterOverrides,
}), expect.anything());
expect(mockIssueService.addComment).toHaveBeenCalledWith(existing.id, "write the whole thing", expect.anything(),
expect.objectContaining({ clientRequestId: "55555555-5555-4555-8555-555555555555" }));
expect.objectContaining({ clientRequestId: "55555555-5555-4555-8555-555555555555" }), expect.anything());
expect(mockIssueService.update.mock.calls[0]?.[2]).toBe(mockIssueService.addComment.mock.calls[0]?.[4]);
// The route dispatches the wake after it sends the response, so wait for
// the fire-and-forget dispatch to settle. This keeps the wake inside this
// test and stops it from leaking into the next test as an extra call.
@@ -378,6 +385,35 @@ describe("issue update comment wakeups", () => {
);
});
it("rolls back adapter settings if the accompanying comment fails", async () => {
const existing = makeIssue({ assigneeAgentId: ASSIGNEE_AGENT_ID, assigneeUserId: null });
let persistedModel = "gpt-6-sol";
mockIssueService.getById.mockResolvedValue(existing);
mockIssueService.update.mockImplementation(async (_id, fields) => {
persistedModel = fields.assigneeAdapterOverrides.adapterConfig.model;
return { ...existing, ...fields };
});
mockIssueService.addComment.mockRejectedValue(new Error("comment write failed"));
const transaction = vi.fn(async (callback: (tx: Record<string, never>) => Promise<unknown>) => {
const previousModel = persistedModel;
try {
return await callback({});
} catch (error) {
persistedModel = previousModel;
throw error;
}
});
const res = await request(await createApp(transaction))
.patch(`/api/issues/${existing.id}`)
.send({ comment: "use Astra", assigneeAdapterOverrides: { adapterConfig: { model: "gpt-6-astra" } } });
expect(res.status).toBe(500);
expect(transaction).toHaveBeenCalledOnce();
expect(persistedModel).toBe("gpt-6-sol");
expect(mockHeartbeatService.wakeup).not.toHaveBeenCalled();
});
it("interrupts the active run and wakes the newly assigned agent with handoff context", async () => {
const existing = makeIssue({
assigneeAgentId: PREVIOUS_AGENT_ID,
+16 -4
View File
@@ -1033,13 +1033,22 @@ function getDeclaredAdapterModels(): ReturnType<typeof parseAdapterModelsEnv> {
return value;
}
function declaredModelsForAdapter(type: string): { id: string; label: string }[] | null {
const declared = getDeclaredAdapterModels()?.[type];
return declared?.length
? declared.map((model) => ({ id: model.id, label: model.label ?? model.id }))
: null;
}
export async function listAdapterModels(type: string): Promise<{ id: string; label: string }[]> {
const declaredModels = getDeclaredAdapterModels();
if (declaredModels && declaredModels[type]?.length) {
return declaredModels[type].map((m) => ({ id: m.id, label: m.label ?? m.id }));
}
const declaredModels = declaredModelsForAdapter(type);
if (declaredModels) return declaredModels;
const adapter = findActiveServerAdapter(type);
if (!adapter) return [];
// The built-in Codex adapter's OpenAI discovery includes image, audio, and
// embedding models that Codex cannot run. Use its curated list; declared
// models above and custom adapter discovery remain authoritative.
if (adapter === codexLocalAdapter) return adapter.models ?? [];
if (adapter.listModels) {
const discovered = await adapter.listModels();
if (discovered.length > 0) return discovered;
@@ -1048,6 +1057,9 @@ export async function listAdapterModels(type: string): Promise<{ id: string; lab
}
export async function refreshAdapterModels(type: string): Promise<{ id: string; label: string }[]> {
const declaredModels = declaredModelsForAdapter(type);
if (declaredModels) return declaredModels;
if (findActiveServerAdapter(type) === codexLocalAdapter) return listAdapterModels(type);
const adapter = findActiveServerAdapter(type);
if (!adapter) return [];
if (adapter.refreshModels) {
@@ -50,7 +50,7 @@ Status quick guide:
- Create subtasks with `POST /api/companies/{companyId}/issues`. Always set `parentId` and `goalId`. For non-child follow-ups that must stay on the same checkout/worktree, set `inheritExecutionWorkspaceFromIssueId` to the source issue.
- When you know the needed work and owner, create those subtasks directly. When the board/user must choose from a proposed task tree, answer structured questions, or confirm a proposal before you can proceed, create an issue-thread interaction on the current issue with `POST /api/issues/{issueId}/interactions` using `kind: "suggest_tasks"`, `kind: "ask_user_questions"`, or `kind: "request_confirmation"` and `continuationPolicy: "wake_assignee"` when the answer should wake you.
- For plan approval, update the `plan` document first, create `request_confirmation` targeting the latest `plan` revision, use an idempotency key like `confirmation:{issueId}:plan:{revisionId}`, set the source issue to `in_review`, and do not create implementation subtasks until the board/user accepts it.
- `ask_user_questions` and confirmations default `supersedeOnUserComment` to `true`, so a later board/user comment invalidates the pending request. Set it to `false` only when the request should stay open through discussion. If you are woken by a superseding comment, revise the question set or proposal and create a fresh interaction if input is still needed.
- `ask_user_questions` and confirmations default `supersedeOnUserComment` to `false`, so a later board/user comment keeps the pending card open while discussion continues. Set it to `true` when a new comment should replace the pending request. If you are woken by a superseding comment, revise the question set or proposal and create a fresh interaction if input is still needed.
- Use `paperclip-create-agent` skill when hiring new agents.
- Assign work to the right agent for the job.
@@ -17,7 +17,7 @@ You are an agent at Paperclip company.
3. Only then create `request_confirmation` with `target={ type: 'issue_document', key: 'plan', revisionId: latestRevisionId }` and `idempotencyKey=confirmation:{issueId}:plan:{revisionId}`.
4. Wait for acceptance before creating implementation subtasks.
Never present a plan only in a thread comment or through `ask_user_questions`; comments are supporting context and questions are for gathering input, not plan review.
- `ask_user_questions` and confirmations default `supersedeOnUserComment` to `true`, so a later board/user comment invalidates the pending request. Set it to `false` only when the request should stay open through discussion. If you wake up from a superseding comment, revise the artifact, question set, or proposal and create a fresh interaction if input is still needed.
- `ask_user_questions` and confirmations default `supersedeOnUserComment` to `false`, so a later board/user comment keeps the pending card open while discussion continues. Set it to `true` when a new comment should replace the pending request. If you wake up from a superseding comment, revise the artifact, question set, or proposal and create a fresh interaction if input is still needed.
- For human input, save a pending question/confirmation interaction and set `in_review`; prose alone does not create a waiting path. Use `blockedByIssueIds` for issue dependencies. An agent may set an `unblockDescriptor` only for itself (`owner: { "agentId": "<your-agent-id>" }` plus `action`), not for the board/user or another agent.
- Respect budget, pause/cancel, approval gates, and company boundaries.
+12 -8
View File
@@ -13729,13 +13729,17 @@ export function issueRoutes(
});
const decision =
transition.decision && decisionId ? transition.decision : null;
let attachmentComment: Awaited<ReturnType<typeof svc.addComment>> | null =
let transactionalComment: Awaited<ReturnType<typeof svc.addComment>> | null =
null;
const attachmentCommentSourceTrust = commentAttachmentIds?.length
const commentWithAdapterOverrides = Boolean(
commentBody && updateFields.assigneeAdapterOverrides !== undefined,
);
const transactionalCommentSourceTrust = commentAttachmentIds?.length || commentWithAdapterOverrides
? await sourceTrustForActorWrite(existing, actor)
: undefined;
const shouldUseTransactionalIssueUpdate =
Boolean(commentAttachmentIds?.length) ||
commentWithAdapterOverrides ||
Boolean(decision) ||
shouldRelayStop ||
persistReviewActivityTransactionally ||
@@ -13750,10 +13754,10 @@ export function issueRoutes(
return null;
const updated = await updateIssue(tx);
if (!updated) return null;
if (commentAttachmentIds?.length) {
// Reassignment, comment creation and upload binding commit together.
// An invalid or already-bound receipt rolls back the issue update.
attachmentComment = await svc.addComment(
if (commentAttachmentIds?.length || commentWithAdapterOverrides) {
// Adapter settings, reassignment, comment and upload binding commit together.
// A failed comment or invalid receipt rolls back the issue update.
transactionalComment = await svc.addComment(
id,
commentBody,
{
@@ -13768,7 +13772,7 @@ export function issueRoutes(
clientRequestId: actor.actorType === "user" ? commentClientRequestId : undefined,
mirrorToSlack: actor.actorType === "user",
authorizationReason: issueMutationAuthorizationReason,
sourceTrust: attachmentCommentSourceTrust,
sourceTrust: transactionalCommentSourceTrust,
},
tx,
);
@@ -14353,7 +14357,7 @@ export function issueRoutes(
}
let comment: Awaited<ReturnType<typeof svc.addComment>> | null =
attachmentComment;
transactionalComment;
let goalCommentSteered = false;
let lostReviewPathRef: string | null = null;
if (commentBody) {
@@ -851,7 +851,7 @@ function normalizeCreateInteractionInput(
...input,
payload: {
...input.payload,
supersedeOnUserComment: input.payload.supersedeOnUserComment ?? true,
supersedeOnUserComment: input.payload.supersedeOnUserComment ?? false,
},
};
case "request_confirmation":
@@ -859,7 +859,7 @@ function normalizeCreateInteractionInput(
...input,
payload: {
...input.payload,
supersedeOnUserComment: input.payload.supersedeOnUserComment ?? true,
supersedeOnUserComment: input.payload.supersedeOnUserComment ?? false,
},
};
case "request_checkbox_confirmation":
@@ -867,7 +867,7 @@ function normalizeCreateInteractionInput(
...input,
payload: {
...input.payload,
supersedeOnUserComment: input.payload.supersedeOnUserComment ?? true,
supersedeOnUserComment: input.payload.supersedeOnUserComment ?? false,
},
};
case "request_item_verdicts":
@@ -875,7 +875,7 @@ function normalizeCreateInteractionInput(
...input,
payload: {
...input.payload,
supersedeOnUserComment: input.payload.supersedeOnUserComment ?? true,
supersedeOnUserComment: input.payload.supersedeOnUserComment ?? false,
},
};
default:
@@ -1700,7 +1700,7 @@ export class PaperclipRunnerToolAuthority {
acceptLabel: normalizedPayload.acceptLabel ?? "Confirm",
rejectLabel: normalizedPayload.rejectLabel ?? "Request changes",
rejectRequiresReason: normalizedPayload.rejectRequiresReason ?? false,
supersedeOnUserComment: normalizedPayload.supersedeOnUserComment ?? true,
supersedeOnUserComment: normalizedPayload.supersedeOnUserComment ?? false,
} : {}),
},
} as never, { agentId: this.binding.agentId, userId: null, identityContextId });