You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6e9d5d6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(console): a host's own mail transport ticks the setup checklist's mail row (#34867)
Fixes#34749
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么:** 控制台首次设置清单按 `source` 判断「在用」:`live.provider` 为 `{ value: null,
source: 'environment' }`(宿主自带、选项表叫不出名字的投递方式)时,邮件行算完成;内置 AI 行同一规则,保留
`environment` 来源。`types.ts` 注释改成 spec 现行说法。
- **为什么改:** #34731 已让托管平台把自带邮件通道报成 `environment` + null,但控制台还要求 value
非空,托管环境的邮件行一直不打勾(#32799 裁决 C 的 ui 半边)。
- **风险与回滚:** 低。只多认一种组合(environment + null);`none`、`settings` + 空串、没有
`live` 时回落到已保存值,这些读数都不变。回滚即 revert 本 PR。
- **先看:**
`ui/apps/console/src/pages/settings/firstRunChecklistLogic.ts`(新
`liveValueInUse` 与 `aiProviderState` 的 null
分支)、`FirstRunChecklist.tsx`(AI
行无名字时的文案)、`__tests__/firstRunChecklistLogic.test.ts` 末尾新增的 describe。
- **两分钟验证:** `pnpm --dir ui exec vitest run
apps/console/src/pages/settings/__tests__/firstRunChecklistLogic.test.ts`,预期全绿,其中「in
use is read from the stated source, never from a null value」下 6 条通过。
- **需要你做的:** 无,席位落地。
## What changes
- **`isMailDelivering`** now reads in-use from the stated `source`, as
the settings contract that #34731 landed says (`SettingsLiveValue` in
service-settings and the spec's `live` describe: "Read in-use from
source, never from a null value"). One private helper, `liveValueInUse`,
holds the rule for both rows. The only new cell is `environment` +
`null`, which is in use. The other cells read as before: `none` is not
in use, `settings`/`environment` with a non-empty string is in use, and
`settings`/`environment` with an empty string is not in use. An entry
that is no statement falls back to the saved values
(`isMailConfigured`), as before.
- **N1 (addendum 6944462303).** A host-own transport whose saved values
pass `isMailConfigured` now reads done from the statement. Before this
change it read not done after #34731.
- **N2: `aiProviderState`** takes the same rule. `environment` + `null`
is now `{ done: true, value: null, source: 'environment' }`, with the
stated source kept. Before this change it was rewritten to `{ done:
false, source: 'none' }`. The `optionLabel` is absent, because no option
names the provider.
- **What the AI row shows for `environment` + `null`.**
`FirstRunChecklist.tsx` has no provider name to put into
`doneEnvironment` ("{{provider}}, detected from the server
environment."), which would render as a sentence starting with a comma.
The row uses the existing, fully translated
`console.settingsView.aiProviderManaged` ("The AI provider, its model
and credentials are managed by the platform.") instead. The Settings
page already shows that sentence for a platform-managed AI provider. No
new i18n key was added, so the file surface stays
`ui/apps/console/src/pages/settings/**`. No runtime emits this AI entry
today (addendum N2).
- **`types.ts`.** The `SettingsLiveValue` comment now carries the spec
rule: `null` when `source` is `none`, or when `source` is `environment`
and no option names what is in use. In-use is read from `source`.
- Changeset `.changeset/34749-mail-delivering-environment.md`:
`@object-ui/console` patch.
## Tests
The pins requested by the dispatch are in
`__tests__/firstRunChecklistLogic.test.ts`, in a new top-level describe,
"in use is read from the stated source, never from a null value
(objectstack#34749)":
- mail: `environment` + `null` is done; `none` is not done; `settings` +
`''` is not done.
- mail N1: saved values that pass `isMailConfigured`, under
`environment` + `null`, read done.
- CONTROL mail: a payload without the statement still falls back to the
saved values.
- ai: `environment` + `null` is done with the source kept as
`environment`; `none` is not done.
- CONTROL ai: a provider named by an option keeps its value, source and
label.
The render pins go into the existing harness,
`__tests__/FirstRunChecklist.test.tsx`. That file gains a `mailLive`
statement for the mail page.
- "managed, the host's own transport (live provider environment, null)
with nothing saved: mail is drawn, done". This is the card's Done-when,
shown on the rendered checklist.
- "handed over by the host and named by no option (environment, null):
done, and says the platform manages it".
<details><summary>Targeted run at 772eafd: 2 files, 77/77</summary>
```
pnpm --dir ui exec vitest run --maxWorkers=2 apps/console/src/pages/settings/__tests__/firstRunChecklistLogic.test.ts apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx
Test Files 2 passed (2)
Tests 77 passed (77)
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>Whole settings directory at 772eafd: 43 files,
432/432</summary>
```
pnpm --dir ui exec vitest run --maxWorkers=2 apps/console/src/pages/settings/
Test Files 43 passed (43)
Tests 432 passed (432)
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>Ablations: one per source-rule change, each red, each
restored to HEAD by byte comparison</summary>
Each ablation was run with `scripts/ablation-replace.mjs` on the
committed head. The console tests resolve `src/` directly, so no `dist/`
step is involved.
1. Deleted `if (source === 'environment' && value === null) return
true;` from `liveValueInUse`. Anchor x1 to x0, blob b179599 to
361413faa503. **5 failed / 72 passed:** both mail cells, N1, the ai
cell, and both render pins. Restored: blob == HEAD, `git diff HEAD`
empty.
2. Put the old N2 mapping back in `aiProviderState`: the `value ===
null` branch returns `{ done: false, value: null, source: 'none' }`.
Anchor x1 to x0, blob b179599 to 3ecd03f4e973. **2 failed / 75
passed:** the ai cell and the AI render pin. Restored: blob == HEAD.
3. Put the renderer back to `doneEnvironment` with an empty provider.
Anchor x1 to x0, blob 0d56897 to 128c62adf365. **1 failed / 76
passed:** the AI render pin. Restored: blob == HEAD.
</details>
## Acceptance notes
- **Producer side.** Nothing was changed upstream. The server
(`judgeLiveValue` in service-settings) already serves `environment` +
`null`, and plugin-email emits it (both from #34731). The console was
the only reader that still required a value.
- **Merge state.** `origin/main` moved 10 commits since the base
e9f65a3, and none of them touches
`ui/apps/console/src/pages/settings/**`. `scripts/pm/overlap-check.mjs`
reports a clean merge against `origin/main` 7752cac. No merge of main
was made.
- **Not run locally, left to CI.** The full Console suite and the
repo-wide lint. ESLint was run on the five touched ui files and exited
0.
## Verification
<details><summary>Local gate subset: dispatch-gates --commands, 37
families, all exit 0; --ran reconciliation clean</summary>
The 37 families were derived by `node scripts/pm/dispatch-gates.mjs
--commands --repo objectstack-ai/objectstack` from commit 772eafd.
Each family ran and exited 0, including `pnpm --dir ui exec vitest run
scripts/` (171 files passed, 2 skipped; 5077 tests passed). `--ran` with
exit codes reported: "37 derived famil(ies) accounted for — 37 run, 0
NOT-MEASURED (a DERIVED zero …)".
Other local checks:
- `pnpm --filter @object-ui/console run type-check` exited 0. Both
touched test files are in that program (`--listFilesOnly` counts 2).
- `ui/scripts/check-new-cross-file-line-citations.mjs` reported 0 new
citations.
The type-check lanes and the wide-population families are CI's.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_012MmDsS4GoHCgYwA2uv3n3C)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(console): the setup checklist reads a host's own mail transport as delivering
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
`GET /api/settings/mail` states a transport that the host hands over, which no provider option names, as `live.provider = { value: null, source: 'environment' }`. The settings contract says in-use is read from `source`, never from a `null` value. The first-run checklist still required a non-empty `value`, so on a hosted environment its Email delivery row stayed not done while mail was being delivered. This included a deployment whose saved mail values would pass on their own.
11
+
12
+
The checklist now reads in-use from `source`. `environment` with a `null` value is in use, `none` is not, and a page without the statement still falls back to the saved mail values. The built-in AI row follows the same rule. If the server ever states its provider as `environment` with a `null` value, the row is done, keeps the `environment` source and says the platform manages the provider, because there is no option name to show.
0 commit comments