Repository navigation
Description
Summary
An action param that borrows a lookup field ({ field, objectOverride }) draws the picker with a "+ New" entry even though the borrowed field declares allowCreate: false. The record created through it is then selected in the picker although it does not match the field's lookupFilters, and running the action is refused by the server.
Measured on @objectstack/* 18.6.0 (console served by the same version), HotCRM 6.6.0, zh-CN, signed in as an admin.
Metadata
The field (crm_expense_report.crm_expense_request):
crm_expense_request: Field.lookup('crm_expense_request', {
label: 'Travel Request',
readonly: true,
lookupFilters: [
{ field: 'owner_id', operator: 'eq', value: '{current_user_id}' },
{ field: 'status', operator: 'eq', value: 'approved' },
],
// A request is filed and approved on its own page first; the picker
// offers no "Create new".
allowCreate: false,
}),The action param (a type: 'script' action on crm_expense, locations: ['record_header'], promoted to the list's selection toolbar):
params: [
{ field: 'crm_expense_request', objectOverride: 'crm_expense_report', required: true },
],Steps
- Open a list of
crm_expense, select one or more rows, choose the action from the selection toolbar (the record-header dialog draws the same picker). - Open the "Travel Request" picker. With no approved request of the user's own it lists no record — the
lookupFiltersare applied. It also offers "+ 新建" (New). - Choose "+ 新建". The full create form of
crm_expense_requestopens; fill it and save. The new request is adraft. - The picker now holds the new draft request as its value.
- Run the action.
Actual
- Step 2: "+ New" is offered, though the field says
allowCreate: false. - Step 4: the created record is selected although it fails the field's
lookupFilters(status = approved); the same record is not in the picker's list when it is reopened. - Step 5: the action answers 400 (its body re-checks the request and refuses it), so the user is led through a create form to a refusal.
Expected
- A field-backed lookup param reads
allowCreatefrom the field it borrows, as it already readslookupFilters,lookupColumns,lookupPageSizeanddescriptionField: withallowCreate: falsethe picker offers no "+ New". - Where quick-create is offered on a picker that has
lookupFilters, a created record that does not match the filters is not left selected (or the user is told why it cannot be chosen).
Where
ui/packages/fields/src/resolveActionParams.ts copies descriptionField, lookupColumns, lookupFilters and lookupPageSize from the resolved field (around lines 880–884) and has no allowCreate among them; ui/packages/app-shell/src/utils/paramToField.ts (around lines 196–205) passes the same four on and no allowCreate. Related, closed: #26951 (the bulk dialog dropped the field's lookupFilters), #34197.
Impact
An app author cannot keep "create" out of an action's picker, so a dialog meant to choose among approved records invites the user to create a new one that the action must then refuse. Found in a browser pass of HotCRM's expense app ("按出差申请报销" / Submit for a Trip).
Activity
objectstack-fleet commentedon Nov 24, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: lands in
area:ux·domain:ui·priority:p1· Bug ·pm:queue· size S.area:recordsis not a North Star area. The p1 grade was set by a person, and it stands.Rationale: the lookup picker in an action's param dialog does not follow the borrowed field's
allowCreate: false, and it keeps a quick-created record that failslookupFiltersselected until the server refuses the run. This sits in the lookup-picker family that repo:objectstack#3 holds (#36825 via PR #36844, and #36832), so it is routed there. The claiming seat should check whether the field-backed param path reads the field'sallowCreateandlookupFiltersthe wayLookupFielddoes.objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB
Claim: PM loop round 5 · 2026-11-24T06:58Z · p1, serial after #36832 (merged) on the seat's order (2026-11-24T05:37Z)
Session:
session_01WGufziG2t1d9cfRQJDrHkBAccount:
os-support-aiBranch:
claude/issue-36865-lookup-param-allowcreate-filtersWorktree:
objectstack-issue-36865Domain:
domain:uiSeat:
repo:objectstack#3Area: ux-C
File surface:
ui/packages/fields/src/resolveActionParams.ts(the borrowed-field copy, ~880–884),ui/packages/app-shell/src/utils/paramToField.ts(~196–205),ui/packages/fields/src/widgets/LookupField.tsx(the quick-create result vs.lookupFilters), their tests, changeset. A change inpackages/spec/**or the server ⇒ stop and report before code.Container & model:
S,mode:subagent,model: opus (TIER_DEFAULT; dispatch-gates --tier: "no path-derived mandate"),effort: mediumClause-②: no — no accept set or public type changes; a field key already declared is now honoured on the param path.
Metadata-protocol: none —
allowCreateandlookupFilterskeep their meaning; the param path stops dropping one of them.Responsibility: platform code in objectstack-ai/objectstack (
ui/packages/fields+ui/packages/app-shellaction-param lookup) produces it | no platform path covers it | every user running an action whose lookup param borrows a field withallowCreate: falseorlookupFilters(HotCRM expense actions, reproduced on 18.6.0); reproduced by the dev on main before codeThread-read: 7123048376
Premise: reported with metadata and steps on 18.6.0 (card body); on main
resolveActionParams.tsandparamToField.tscopydescriptionField,lookupColumns,lookupFilters,lookupPageSizeand noallowCreate(card's reading; the dev confirms on main before code). The second half (a created record that failslookupFiltersstays selected) is measured by the dev; the fix chooses between not selecting it and telling the user why — say which.Pre-claim lane: domain:ui —
ui/packages/fields/src/resolveActionParams.ts,ui/packages/app-shell/src/utils/paramToField.ts,ui/packages/fields/src/widgets/LookupField.tsxPre-claim deps: none (no
Blocked-by:); #36832 (same fileLookupField.tsx) merged as97e0f934; overlap census: no open PR touches these files (read 2026-11-24T06:53Z);overlap-check.mjsruns before each push.Prior rulings read: allowcreate,lookupfilters,objectoverride,quick-create → 0 hits; none; thread: none; repo: objectstack-ai/objectstack
Serial constraints cleared: #36852 (this area, queued, PeoplePicker scroll lock) may also touch
LookupField.tsx; not claimed, goes after this card.Resume-from: none
Fold-or-serial: alone. #36852 shares the file but not the defect or the fix (① fails).
objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB
os-dev-report
Reported 2026-11-24T07:02Z.
{ "issue": 36865, "status": "blocked", "branch": "claude/issue-36865-lookup-param-allowcreate-filters", "pr": null, "session": "session_01WGufziG2t1d9cfRQJDrHkB", "premise_still_valid": true, "summary": "Stopped at the fence before code, per the dispatch rule for files outside the claimed File surface. Premise confirmed by source reading on origin/main 370e14d8a: resolveActionParams.ts lookupExtras (lines 878-885) copies descriptionField/lookupColumns/lookupFilters/lookupPageSize and no allowCreate; paramToField.ts (196-205) forwards the same four; LookupField.tsx 484-486 then defaults allowCreate to isUserFacingReference(reference), so a crm_expense_request picker offers create. Half 1 cannot land inside the fence: (1) ActionParamDef in ui/packages/core/src/actions/ActionRunner.ts (lines 958-980, no index signature) declares no allowCreate, so lookupExtras: Partial of ActionParamDef and param.allowCreate in paramToField do not type-check without one added optional member; (2) the card's own repro path is the list selection toolbar, which resolves through ui/packages/plugin-grid/src/resolveBulkActions.ts toBulkParam (lines 171-196) - it carries the same four keys under their own names and would drop allowCreate even after the fence files are fixed. Half 2 fits the fence for the not-selected arm (re-read the created id through the picker's own popoverFilter with mergeFilterNodes, as the recents rail does at lines 1500-1507; absent means do not select). The told-why arm needs a new lookup.* string: ui/packages/i18n/src/locales/*.ts (11 packs) plus the FIELD_DEFAULTS row in ui/packages/fields/src/widgets/useFieldTranslation.ts, also outside the fence. Size stays S with the widened fence (about 6 code lines across core and plugin-grid, plus one string). Branch pushed empty as the routing probe; no commits.", "tests": "NOT MEASURED: runtime pin of the premise (allowCreate:false on a field-backed param still draws create), reason: stopped at the fence before install and build; the premise rests on source reads at origin/main 370e14d8a cited in summary. No tests run, no ablation (no code).", "gates": "local: node scripts/pm/overlap-check.mjs -> VERDICT clean exit 0 (0 files, merges cleanly with origin/main 370e14d8a0). No package touched, so no build closure, no package tests, no derived families. CI: no PR, no check-runs.", "line_budget": "n/a - no diff", "files_changed": [], "deviations": "none. Fence widening requested rather than taken. Runtime premise pin not taken (NOT MEASURED above).", "dogfood_battery": "n/a - no PR", "mcp_calls": "0", "api_writes": "1 - this report comment via scripts/pm/post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/36865/comments); git push of the empty branch is not a REST write", "open_questions": [ { "question": "Widen the File surface for half 1 to ui/packages/core/src/actions/ActionRunner.ts (one optional allowCreate member on ActionParamDef, plus its test-free doc line) and ui/packages/plugin-grid/src/resolveBulkActions.ts (carry allowCreate in toBulkParam, plus its test), so both the record-header dialog and the selection-toolbar dialog honour the field's allowCreate:false?", "options": [ "A widen to both files: the card's own repro path (selection toolbar) is fixed in the same PR; no spec or server change; allowCreate also joins RESOLVED_ONLY_PARAM_KEYS in the fenced resolver file", "B widen to ActionRunner.ts only: record-header dialog fixed, selection toolbar stays broken and needs a follow-up card", "C keep the fence: half 1 cannot type-check; only half 2 lands" ], "recommendation": "A, because the repro in the card is the toolbar path and B leaves the reported symptom in place; cost is about six lines and two pins" }, { "question": "For half 2, may the user be told why a just-created record was not selected (new lookup.* string in ui/packages/i18n/src/locales/*.ts and the FIELD_DEFAULTS row in useFieldTranslation.ts), or should the fix only leave it unselected (in-fence, satisfies the card's Expected via its 'or')?", "options": [ "A widen to the i18n packs and useFieldTranslation.ts: not selected, and the picker's existing error line (role=alert, the createError slot) says the record was created but does not match this field's filters", "B keep the fence: not selected, no message; the user sees the modal close and the picker stay empty" ], "recommendation": "A, because B silently swallows a record the user just saved; A reuses the existing createError display and costs one string in 11 packs" } ], "security_findings": "withheld", "out_of_scope_findings": [ "carrier: none - noted, not filed: ui/packages/types/src/__tests__/page-nav-misc-spec-parity.test.ts pins the resolved-only picker group as nine keys; if allowCreate joins RESOLVED_ONLY_PARAM_KEYS the parity test can gain a tenth ts-expect-error line (optional, same widening)" ], "Dev-effort": "medium", "Rounds": "1" }objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB
Claim amendment · 2026-11-24T07:04Z · amends claim 7124488286 after the os-dev report 7124565256 (blocked at the fence before code). Seat route (2026-11-24T07:04Z), a route call, not a maintainer ruling: widen for both halves, size stays
S.File surface (added to the claim's line):
ui/packages/core/src/actions/ActionRunner.ts— one optionalallowCreatemember on the exportedActionParamDef;ui/packages/plugin-grid/src/resolveBulkActions.ts—toBulkParamcarriesallowCreate(the selection-toolbar path of the card's repro), with a pin;allowCreatejoinsRESOLVED_ONLY_PARAM_KEYSinresolveActionParams.ts(and, optionally, the parity pin inui/packages/types/src/__tests__/page-nav-misc-spec-parity.test.ts);lookup.*string in the 11ui/packages/i18n/src/locales/*.tspacks (zh-CN, ja-JP and es-ES written by hand, not an English echo) plus itsFIELD_DEFAULTSrow inui/packages/fields/src/widgets/useFieldTranslation.ts, shown in the picker's existingcreateErrorslot when a quick-created record fails the field'slookupFiltersand is therefore not selected.Changeset gains
@object-ui/coreand@object-ui/plugin-grid(and@object-ui/i18nif it ships).Clause-②: yes (widening) — an optional member on the published
@object-ui/coreActionParamDef; replaces the claim'sClause-②: no. L2 owed atTIER_DEFAULT(declaration-only face), run by L1-a.Metadata-protocol: none — stands.
objectstack-fleet commentedon Nov 24, 2026
repo:objectstack#3 · os-support-ai · session_01WGufziG2t1d9cfRQJDrHkB
Close-out: 2026-11-24T10:39Z · area ux-C · landed by PR #36919 (merge
49c6bf3d513efd3d15a82f5a54b7887563eb0439, heada0cfa725a7b1f24dd7eb706bf28ab45817e0b853, L1 ACCEPT 7128519679, contract-review delta PASS 7128510004). A lookup param on an action dialog now honours the field'sallowCreateand its filters. A record created from the picker is selected only once it is checked against the field's filters. A record that fails the check, or whose check could not run, is not chosen, and the picker says so. A create error now shows as a notice above a list that stays usable, which also ends the older lock-out after a failed inline create. Carry-over: the bulk-param prescription text (S3) is spec card #36927. N2b/N2c stay nits (L1). Browser reach not measured.pm:dispatchedremoved.