Files
PaperClipAI/ui/src/components
DottaandPaperclip f0d4f6c3eb Remember model and effort in the task composer (#23698)
## Thinking Path

> - Paperclip manages work for AI agents.
> - People use the new-task composer to select an agent and its run
settings.
> - The composer remembers the last agent. A new draft opens with the
agent's default model.
> - People who use a different model must select it again.
> - This change remembers the selected model and effort for the agent in
that company.
> - The next draft can use those settings as soon as the agent is
selected.

## Linked Issues or Issue Description

**What happened?**

The new-task composer forgot the selected model when the next draft
opened. It could restore an effort without restoring the model that went
with it.

**Expected behavior**

The next new-task draft for the same agent starts with the last selected
model and effort. Reset to agent default clears both choices.

**Steps to reproduce**

1. Open the new-task composer and select an agent.
2. Select a different model and change the effort.
3. Close the composer and open a fresh task for the same agent. Check
the model and effort.

**Paperclip version or commit**

Base commit: `3f882fc5895072e9a63e46df0eb0e1dad75f092b`.

**Deployment mode**

The regression runs in the UI component test environment. The browser
preference is available in all deployment modes.

## What Changed

- Save the model and effort when a person changes either value in the
new-task picker. Store them in the current browser for the company,
agent, and harness.
- Restore the model and effort together. Keep explicit draft and task
settings when present.
- Share explicit effort choices and resets with conversation composers.
A new-task composer uses the company-wide effort when the selected agent
has no saved choices and its model supports that effort.
- Keep the saved effort while model discovery is pending. When discovery
confirms support, record the validated model for the next draft. A late
result applies only to the draft settings that were waiting for it and
preserves newer saved choices.
- Cover fresh drafts, agent changes, explicit draft settings and
inherited overrides, incomplete model catalogs, and reset.

## Verification

- The regressions failed when a fresh composer forgot the model, when
conversation composers lost the shared effort preference, and when
selecting a model during discovery cleared that preference.
- A reload before discovery reproduced effort loss after the initial
draft had restored the effort. The regression now passes.
- All 190 tests passed across the task composer, composer run settings,
and recent selections suites on
`d155e3e5489f8635b97e746b2d86b208ae30ed49`.
- UI typecheck passed after the plugin SDK build supplied its generated
declarations.
- `pnpm verify` stopped before test selection because the workspace Git
storage guard could not run Git. The three focused Vitest files ran
directly.

- GitHub CI passed on the same revision, including typecheck, build,
verification, and end-to-end tests. [CI
run](https://github.com/paperclipai/paperclip/actions/runs/47260521316)

- The merge with master keeps recent-assignee ordering and composer
preferences. All 193 focused tests and UI typecheck passed on
`d8dca2d2ca6535dcab1bc2ebf2cf4c9926b37664`. GitHub CI and review are
pending for this revision.

## Risks

- The preference is local to the browser. If browser storage is
unavailable, the composer uses the agent and draft settings.
- Model access and support remain subject to validation when a run
starts.

## Model Used

- OpenAI GPT-6 Codex coding agent with terminal and GitHub tool access.

## 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
- [x] My branch name describes the change and contains no internal task
ID
- [x] I have run focused tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have documented the behavior in this PR
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] 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>
2026-12-04 17:45:39 -06:00
..