@toloka-platform/sdk 0.19.0 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,248 +0,0 @@
1
- # Pipeline testing examples
2
-
3
- Import the ready-to-use Vitest helpers from `@toloka-platform/sdk/testing`. The same entry point executes authored Python code nodes and renders human-work Task UIs in an isolated Chromium context.
4
-
5
- ## Code node scenarios
6
-
7
- ```ts
8
- import { expect, test } from "@toloka-platform/sdk/testing";
9
- import pipeline from "../../pipeline";
10
- import { classify } from "./node";
11
-
12
- const scenarios = [
13
- { text: "A refund was requested", expected: "billing" },
14
- { text: "The app crashes", expected: "technical" },
15
- ];
16
-
17
- for (const scenario of scenarios) {
18
- test.code(pipeline, classify, `classifies ${scenario.text}`, async ({ run }) => {
19
- await expect(run({ text: scenario.text })).resolves.toEqual({ category: scenario.expected });
20
- });
21
- }
22
-
23
- test.code(pipeline, classify, "surfaces authored failures", async ({ run }) => {
24
- await expect(run({ text: "" })).rejects.toMatchObject({
25
- name: "CodeNodeExecutionError",
26
- exitCode: 1,
27
- stderr: expect.stringContaining("text is required"),
28
- });
29
- });
30
- ```
31
-
32
- Pass test-only secret values through the bound `run(inputs, { env })`; authored static environment entries are applied automatically. Use `pythonExecutable` only when the project intentionally tests another Python binary, and lower `timeoutMs` for timeout behavior.
33
-
34
- ## Complete pipeline flow
35
-
36
- Start with the first row from the same local dataset file intended for upload. Keep that row as a TypeScript fixture; if it contains sensitive values, redact the values while preserving the real field names, nesting, optionality, and media/value shapes. Use synthetic input only when no local row exists.
37
-
38
- ```ts
39
- import { expect, test } from "@toloka-platform/sdk/testing";
40
- import pipeline from "../pipeline";
41
- import { representativeTicket } from "./fixtures/support-ticket";
42
- import { normalizeTicket } from "../nodes/normalize-ticket/node";
43
- import { classifyTicket } from "../nodes/classify-ticket/node";
44
- import { finalizeTicket } from "../nodes/finalize-ticket/node";
45
-
46
- test.pipeline(
47
- pipeline,
48
- "moves a representative item from root.started to root.completed",
49
- async ({ runCode, renderUi }) => {
50
- let item: Record<string, unknown> = { ...representativeTicket };
51
-
52
- item = { ...item, ...(await runCode(normalizeTicket, item)) };
53
-
54
- const classificationTask = await renderUi(classifyTicket, { data: item });
55
- await classificationTask.setValue("category", "billing");
56
- await classificationTask.setValue("rationale", "The customer disputes a duplicate charge.");
57
- const classification = await classificationTask.submit();
58
- item = {
59
- ...item,
60
- category: classification.category,
61
- rationale: classification.rationale,
62
- };
63
-
64
- item = { ...item, ...(await runCode(finalizeTicket, item)) };
65
-
66
- expect(item).toMatchObject({
67
- ticket_id: representativeTicket.ticket_id,
68
- category: "billing",
69
- resolution_status: "ready",
70
- });
71
- },
72
- );
73
- ```
74
-
75
- This explicit item-state threading is the local equivalent of following pipeline connections: pass root input to the first node, merge its output, and continue until the completed fields are available. Keep this happy path in one test when the graph is linear. Use separate tests for each match branch or materially different path. For quorum, collect several simulated Task UI submissions and assemble each outer annotation array before calling a downstream code node.
76
-
77
- ## Default Task UI fixture
78
-
79
- ```ts
80
- import { expect, test } from "@toloka-platform/sdk/testing";
81
- import pipeline from "../../pipeline";
82
- import { annotate } from "./node";
83
-
84
- test.ui(pipeline, annotate, "submits a valid answer", async ({ render }) => {
85
- const task = await render({
86
- data: { prompt: "What is two plus two?" },
87
- });
88
-
89
- await task.setValue("raw_answer", "four");
90
-
91
- expect(await task.validationErrors()).toEqual([]);
92
- expect(await task.submit()).toMatchObject({ answer: "four" });
93
- });
94
- ```
95
-
96
- The browser is created once per Vitest worker. The typed wrapper's `render` helper creates an isolated browser context and page for the scenario. Every opened Task UI session is closed automatically after the scenario, including failed scenarios.
97
-
98
- ## Several TypeScript scenarios
99
-
100
- Scenarios are ordinary TypeScript. Use shared builders and loops instead of generating a separate JSON scenario format.
101
-
102
- ```ts
103
- import { expect, test } from "@toloka-platform/sdk/testing";
104
- import pipeline from "../../pipeline";
105
- import { classify } from "./node";
106
-
107
- const scenarios = [
108
- { name: "short text", data: { text: "yes" } },
109
- { name: "long text", data: { text: "a long paragraph" } },
110
- { name: "empty optional context", data: { text: "yes", context: null } },
111
- ];
112
-
113
- for (const scenario of scenarios) {
114
- test.ui(pipeline, classify, scenario.name, async ({ render }) => {
115
- const task = await render({ data: scenario.data });
116
-
117
- await task.setValue("label", "accepted");
118
-
119
- expect(await task.validationErrors()).toEqual([]);
120
- expect(await task.submit()).toMatchObject({ label: "accepted" });
121
- });
122
- }
123
- ```
124
-
125
- Each scenario receives a fresh browser context, so values set by one scenario cannot satisfy another scenario.
126
-
127
- ## Inspect component contracts
128
-
129
- Component documentation comes from the same TBX launcher used to render the interface.
130
-
131
- ```ts
132
- import { expect, test } from "@toloka-platform/sdk/testing";
133
- import pipeline from "../../pipeline";
134
- import { classify } from "./node";
135
-
136
- test("uses the expected Field contract", async ({ ui }) => {
137
- const task = await ui.render(pipeline, classify);
138
- const documentation = await task.componentDocumentation(["Field.RadioGroup", "View.Card"]);
139
-
140
- expect(documentation).toMatchObject({
141
- "Field.RadioGroup": { valueType: expect.stringContaining("string") },
142
- "View.Card": { propsType: expect.stringContaining("title") },
143
- });
144
- });
145
- ```
146
-
147
- Requesting an unknown component rejects with an actionable error. It does not silently return an empty entry.
148
-
149
- ```ts
150
- await expect(task.componentDocumentation(["Field.Invented"])).rejects.toThrow(
151
- "Unknown Task UI components: Field.Invented",
152
- );
153
- ```
154
-
155
- ## Assert browser validation failures
156
-
157
- ```ts
158
- import { expect, TaskUiValidationError, test } from "@toloka-platform/sdk/testing";
159
- import pipeline from "../../pipeline";
160
- import { annotate } from "./node";
161
-
162
- test("requires an answer", async ({ ui }) => {
163
- const task = await ui.render(pipeline, annotate);
164
-
165
- expect(await task.validationErrors()).toEqual([expect.objectContaining({ path: "raw_answer" })]);
166
-
167
- await expect(task.submit()).rejects.toBeInstanceOf(TaskUiValidationError);
168
- });
169
- ```
170
-
171
- `TaskUiValidationError` exposes three structured fields:
172
-
173
- - `formErrors` contains browser component validation failures.
174
- - `entityErrors` contains postprocessed output values that fail entity schemas.
175
- - `coverage` reports untested hardware-backed fields.
176
-
177
- ## Assert postprocessed output
178
-
179
- `submit()` returns the final Task UI output after postprocess runs. Launcher-only `_context` metadata is removed.
180
-
181
- ```ts
182
- const task = await ui.render(pipeline, normalizeBox);
183
-
184
- await task.setValue("raw_box", {
185
- x: 20,
186
- y: 10,
187
- width: 100,
188
- height: 50,
189
- });
190
-
191
- expect(await task.submit()).toEqual({
192
- raw_box: { x: 20, y: 10, width: 100, height: 50 },
193
- box: { x: 0.2, y: 0.1, width: 1, height: 0.5 },
194
- });
195
- ```
196
-
197
- The submitted result is also checked against every non-hardware output entity schema declared by the authored node.
198
-
199
- ## Hardware-backed fields
200
-
201
- Headless Chromium cannot complete native file pickers, cameras, microphones, or recording components. By default, `submit()` rejects rather than claiming complete coverage.
202
-
203
- ```ts
204
- const task = await ui.render(pipeline, recordVideo);
205
-
206
- expect(task.coverage.complete).toBe(false);
207
- expect(task.coverage.untestedHardwareFields).toContain("video");
208
- await expect(task.submit()).rejects.toThrow("hardware-backed fields");
209
- ```
210
-
211
- When the scenario deliberately verifies only the testable fields, acknowledge partial coverage explicitly:
212
-
213
- ```ts
214
- const task = await ui.render(pipeline, recordVideo, {
215
- allowPartialCoverage: true,
216
- });
217
-
218
- await task.setValue("description", "A short outdoor video");
219
- expect(await task.submit()).toMatchObject({
220
- description: "A short outdoor video",
221
- });
222
- expect(task.coverage.complete).toBe(false);
223
- ```
224
-
225
- A partial scenario is useful for structure and supporting fields, but it is not full verification of the hardware workflow.
226
-
227
- ## Manual cleanup
228
-
229
- Automatic teardown is sufficient for normal tests. Call `close()` only when a long scenario no longer needs a page and should release it early.
230
-
231
- ```ts
232
- const task = await ui.render(pipeline, annotate);
233
-
234
- await task.screenshot("test-results/initial.png");
235
- await task.close();
236
- ```
237
-
238
- `close()` is idempotent. The fixture’s automatic teardown can safely call it again.
239
-
240
- ## Setup and execution
241
-
242
- Install any missing test tools as described in [Test pipelines locally](./testing.md#install-test-dependencies). Then run:
243
-
244
- ```sh
245
- toloka check
246
- ```
247
-
248
- The local browser still downloads the hosted launcher, so use synthetic or redacted test data. `toloka check` runs project types, automatic Task UI types, typed node tests, and pipeline-flow evidence. Remote Node Checks remain separate platform jobs.
package/docs/testing.md DELETED
@@ -1,125 +0,0 @@
1
- # Test pipelines locally
2
-
3
- The `@toloka-platform/sdk/testing` entry point provides typed Vitest wrappers for executable Python `code` nodes, Chromium Task UI scenarios, and complete pipeline flows. `toloka check` runs those tests together with project TypeScript and automatic Task UI typechecking without creating or modifying a platform project.
4
-
5
- ## Install test dependencies
6
-
7
- The standalone CLI includes its runtime, but project test runners and browser binaries remain project dependencies. Bun is the recommended runtime and package manager for SDK development. In an existing project, install its declared dependencies first:
8
-
9
- ```sh
10
- bun i
11
- ```
12
-
13
- When they are not already declared, add Vitest and Playwright and install Chromium:
14
-
15
- ```sh
16
- bun add -d vitest playwright
17
- bunx playwright install chromium
18
- ```
19
-
20
- Executable code-node tests also require `python3` on the test machine. The platform runs code nodes on Python 3.12 with the standard library only, so a program that imports a package installed only on the test machine passes locally and fails on the platform. Browser-backed Task UI tests use the separately downloaded Playwright Chromium binary and require network access to the hosted launcher. Training-only CLI workflows require none of these project test tools or a separate JavaScript runtime. See [testing examples](./testing-examples.md) for parameterization, validation failures, hardware coverage, and cleanup patterns.
21
-
22
- ## Test a code node
23
-
24
- `test.code(pipeline, node, name, callback)` binds one test to one authored code node. Its `run(inputs, options?)` helper executes the Python source with the same async `main(inputs)` entry contract. The test counts as node coverage only after `run` executes, at least one assertion runs, and the callback passes.
25
-
26
- ```ts
27
- import { expect, test } from "@toloka-platform/sdk/testing";
28
- import pipeline from "../../pipeline";
29
- import { normalize } from "./node";
30
-
31
- test.code(pipeline, normalize, "normalizes whitespace", async ({ run }) => {
32
- await expect(run({ text: " hello " })).resolves.toEqual({
33
- normalized_text: "hello",
34
- });
35
- });
36
- ```
37
-
38
- Failures from the bound executor throw `CodeNodeExecutionError` with the Python exit code and stderr. Authored static environment values are included; pass secret or test-specific values through the optional `run` options. Third-party imports must be available to the selected Python executable.
39
-
40
- `test.code` defaults to 30 seconds, which exceeds the code runner's 10-second default. Pass `{ timeout: milliseconds }` after the callback when the scenario also raises the runner timeout.
41
-
42
- ## Test a complete pipeline flow
43
-
44
- Register the representative connected scenario with `test.pipeline(pipeline, name, callback)`. Its callback provides `runCode(node, inputs, options?)` and `renderUi(node, options?)` bound to that pipeline.
45
-
46
- Use the first row from the same local dataset file intended for upload when one is available. If it contains sensitive values, keep a redacted fixture that preserves field names, nesting, optionality, and media/value shapes. Use synthetic input only when no local row exists. `test.pipeline` does not fetch a live dataset: the local gate remains deterministic, credential-free, and usable before apply. Treat the fixture as `root.started` item state, execute connected nodes in order, merge only each node's declared outputs, and assert the fields accepted by `root.completed`. A linear happy path can stay in one test; use separate scenarios for materially different match branches, optional paths, and failures.
47
-
48
- ## Test a Task UI
49
-
50
- Create a file ending in `.ui.spec.ts` next to the human-work node. `test.ui` binds the test to the pipeline and node, and its callback receives `render(options?)` for that target. The test counts as coverage only after a successful submission, at least one assertion, and a passing callback.
51
-
52
- Browser-backed `test.ui` scenarios default to 60 seconds, which exceeds the launcher's 45-second setup budget. `test.pipeline` scenarios default to 120 seconds for connected flows with multiple UI steps. Pass `{ timeout: milliseconds }` after the callback to tune either wrapper without weakening its inner launcher deadlines.
53
-
54
- ```ts
55
- import { expect, test } from "@toloka-platform/sdk/testing";
56
- import pipeline from "../../pipeline";
57
- import { annotate } from "./node";
58
-
59
- test.ui(pipeline, annotate, "submits a valid answer", async ({ render }) => {
60
- const task = await render({
61
- data: { prompt: "What is two plus two?" },
62
- });
63
-
64
- await task.setValue("raw_answer", "four");
65
-
66
- expect(await task.validationErrors()).toEqual([]);
67
- expect(await task.submit()).toMatchObject({
68
- answer: "four",
69
- });
70
- await task.screenshot("test-results/answer.png");
71
- });
72
- ```
73
-
74
- Run the complete gate rather than invoking Vitest separately:
75
-
76
- ```sh
77
- toloka check
78
- ```
79
-
80
- Use an ordinary TypeScript loop to register several `test.code` or `test.ui` scenarios. There is no separate JSON scenario format.
81
-
82
- ## Fixture API
83
-
84
- The low-level `ui` fixture remains available inside ordinary Vitest tests for component discovery and exploratory work, but plain tests do not satisfy required node coverage. Use typed wrappers for committed gate evidence. Importing `@toloka-platform/sdk/testing` from a plain Bun script executes Vitest fixture setup and fails.
85
-
86
- - `ui.componentDocumentation(names?)` returns the current launcher's supported component contracts. `ui` is a fixture argument of `test` (`test("…", async ({ ui }) => …)`), not an export. Outside a test, `toloka ui components [names...]` prints the same contracts.
87
- - `ui.render(pipeline, node, options)` creates a fresh browser context and returns a Task UI session for exactly that authored node. `test.ui` supplies the equivalent bound `render(options?)` helper.
88
-
89
- The returned Task UI session supports:
90
-
91
- - `componentTree()` returns the rendered component hierarchy.
92
- - `componentDocumentation(names?)` returns component props, value shapes, capabilities, and limitations.
93
- - `setValue(path, value)` and `getValue(path)` address Fields by their stable `path`, not generated component ids.
94
- - `validationErrors()` returns browser-level required-field and component-rule failures with Field paths.
95
- - `submit()` executes preprocess/postprocess, removes the launcher's `_context`, and validates declared output entities. The returned form data can also contain echoed inputs; assert output-entity keys and values without treating those inputs as output entities.
96
- - `screenshot(path)` writes a full-page PNG to the local filesystem.
97
- - `coverage` states whether hardware-backed fields were exercised completely.
98
-
99
- One Chromium process is shared per Vitest worker. Every scenario gets a fresh context and page and is cleaned up automatically.
100
-
101
- For a structured or array-valued Field, derive the dataset field schema from the component's documented `valueType`. In its typed UI scenario, adapt only semantic values such as labels, then pass the documented example value through `setValue`, `getValue`, and `submit`. This catches component-shape drift before a postprocess can read absent keys and silently write fallback data.
102
-
103
- ## Runtime rules
104
-
105
- `ui.code` must parse as one TSX root. Every identifier must be a component returned by `componentDocumentation()` or a documented `actions` API. `toloka check` applies full TypeScript semantic checking with declarations bundled in the SDK; the real launcher then renders the same TSX in browser scenarios. Treat a component's `propsType` and `example` together as its contract.
106
-
107
- `preprocess` and `postprocess` are JavaScript function bodies, not TypeScript:
108
-
109
- Valid JavaScript: `items.map((item) => item.value)`
110
-
111
- Invalid runtime JavaScript: `items.map((item: unknown) => item.value)`
112
-
113
- Only `data` is in scope in `preprocess` and `postprocess`. `CONST` exists only in `ui.code`, so `toloka check` reports `Cannot find name 'CONST'` when either function reads it: write the value inline in the function, or read it from `ui.code` instead.
114
-
115
- `preprocess` can run again after form state changes. Use it to shape input data; if it prefills a bound field, return that key only while it is absent so later edits are not overwritten. A `Field`-bound top-level key already enters the submission. `postprocess` must return only new top-level keys: bind a component to a draft key when postprocess must derive a different entity key.
116
-
117
- The fixture loads the hosted TBX launcher in a fresh local Chromium context, so tests require network access but do not use Azure Playwright or Potato application services. The context has no platform cookies or credentials. Use synthetic or redacted fixtures because the hosted launcher executes with access to the supplied test data.
118
-
119
- ## Hardware-backed fields
120
-
121
- File pickers, video upload/recording, and other hardware-backed fields cannot be completed reliably in headless Chromium. `task.coverage.complete` is `false` when these components are present. Render with `allowPartialCoverage: true`, inject one value matching the component's documented `valueType` through `setValue`, and assert the postprocessed output shape yourself: entity validation skips hardware-backed paths, and `getValue` may not serialize their launcher state. This checks browser validation and mapping only, not capture, upload, link generation, or record-time constraints. A partial result must not be described as complete coverage.
122
-
123
- ## Final gate
124
-
125
- `toloka check` loads every authored pipeline, runs the project TypeScript compiler, typechecks every Task UI against declarations bundled with the installed SDK, runs Vitest, and requires passing `test.code`, `test.ui`, and `test.pipeline` evidence. `missing`, `failed`, and `infrastructure_error` are distinct blocking outcomes. `partial` is reported for a Task UI with hardware-backed fields and does not block: verify those fields on a real device before launching a run. `toloka apply` reruns this complete gate before resolving credentials or writing platform state. Platform validation remains separate: a `not_ran_node_check` warning describes Remote Node Check state rather than missing local evidence.
@@ -1,115 +0,0 @@
1
- # Troubleshooting
2
-
3
- The failures you will actually hit, what causes each, and the next step that works.
4
-
5
- Platform behavior described here has been reproduced against a live platform. Installation entries describe the shipped installer and CLI. Where the right fix is platform-side rather than local, this page says so instead of suggesting a workaround that does not exist.
6
-
7
- ## Installer succeeded but the shell runs an old CLI
8
-
9
- Run `toloka version --json`. If it reports `"channel":"global-registry"` or an unexpected version or path, follow [Updates and migration from Bun global installs](./cli.md#updates-and-migration-from-bun-global-installs). Rerun the installer for an immediate update; there is no `toloka update` command.
10
-
11
- ## plan reports a change immediately after apply
12
-
13
- Run `plan` once more. If it still reports the same change, the source and the platform genuinely disagree and the diff names the node and setting.
14
-
15
- `plan` compares only the settings your source declares. A setting the platform materialized but your source never wrote is owned by the platform and is not drift. The consequence worth knowing: deleting a setting from source does not report the live value as a difference. To change a materialized setting, declare it explicitly with the value you want.
16
-
17
- ## Dataset field schema conflict
18
-
19
- ```
20
- Dataset field schemas conflict with source: cat-images.annotations
21
- ```
22
-
23
- Dataset columns are immutable. The column exists with a different JSON Schema than your source declares, and neither `plan` nor `apply` will rewrite it. There is no operation on the platform that alters or removes a dataset field.
24
-
25
- Two ways forward:
26
-
27
- - Declare a new column name with the schema you want, and migrate readers to it.
28
- - Bind the pipeline to a new dataset.
29
-
30
- Neither is a workaround; they are the only two shapes the platform supports. See [datasets](./datasets.md).
31
-
32
- ## Missing project secrets
33
-
34
- ```
35
- Required secrets are missing: OPENAI_API_KEY
36
- ```
37
-
38
- `apply` refuses before writing anything. Set every name it lists, then plan again:
39
-
40
- ```sh
41
- toloka secret set OPENAI_API_KEY --from-env OPENAI_API_KEY
42
- ```
43
-
44
- Values are read from stdin or a named environment variable so they do not reach shell history or process listings. Node settings reference secret names; they never carry values.
45
-
46
- ## Refusing to delete pipelines or datasets
47
-
48
- ```
49
- Refusing to delete pipelines absent from source: pipelines/cat-labeling
50
- ```
51
-
52
- A resource exists on the platform but not in your source tree. `apply` reports it and stops rather than deleting live work — deleting a pipeline is not a side effect of an edit. Either restore the source, or remove the resource deliberately through the platform UI.
53
-
54
- ## 409 stale version
55
-
56
- Another writer changed the graph after your source was read. Do not retry blindly: `plan` again to re-read live state, review the new diff, carry any intentional remote change into source, then `apply`.
57
-
58
- ## Another upload is already in progress
59
-
60
- ```
61
- 409 Another upload is already in progress
62
- ```
63
-
64
- A previous upload to that dataset failed after the upload row was created, and a pending upload counts as in progress. There is no public operation to cancel it, so the dataset's upload path stays blocked. Load the rows into a new dataset, and report the dataset id so the pending upload can be cleared platform-side.
65
-
66
- ## toloka dataset fields prints nothing for a dataset that has rows
67
-
68
- Column inference runs on the file-upload path only. Rows added through the items endpoint are stored without inference, so a dataset can visibly hold rows and still report zero inferred fields. Declare the columns in source instead of relying on inference.
69
-
70
- ## Starting a run returns 500
71
-
72
- `toloka pipeline run` can fail with a bodyless `500` transiently. Before retrying, check whether a run was created anyway:
73
-
74
- ```sh
75
- toloka pipeline runs <name>
76
- ```
77
-
78
- If it lists no new run, retry. The same call has succeeded minutes later with no configuration change.
79
-
80
- ## Exit code 2 from toloka pipeline run
81
-
82
- Read the output first: exit `2` has two causes.
83
-
84
- If it says `Did not start a run of <name>: its lints are still running`, no run was created. The platform rejects a run until the lints of the nodes on the path from Start to End have finished. Do not look for a run with `toloka pipeline status`: wait for the lints with `toloka pipeline lint <name> --wait`, then run `toloka pipeline run` again.
85
-
86
- Otherwise the timeout closed while the run was still in progress. That is not a failure of the run and not a failure of your pipeline. A queue with no one working it stays in progress indefinitely, so report what you observed — item counts and current states — rather than waiting unbounded:
87
-
88
- ```sh
89
- toloka pipeline status <name>
90
- toloka pipeline results <runId> --failed
91
- ```
92
-
93
- ## apply succeeded but the pipeline will not deploy
94
-
95
- `toloka validate` reports platform spec errors and the latest matching check jobs without writing the graph. `apply` writes the graph. Neither certifies that the pipeline is ready to launch. Deployment gates that live outside that report — an enabled Training course with no content, or a labeler UI that has not been validated — surface in the platform UI, not in the CLI.
96
-
97
- ## Missing credentials
98
-
99
- ```
100
- Not logged in. Run toloka login once to sign in through your browser on this machine:
101
- ```
102
-
103
- Run `toloka login`. Where a browser is not available, pipe a long-lived API key to `toloka login --api-key-stdin` or set `TOLOKA_API_KEY`; set `TOLOKA_SCOPED_TOKEN` when using an issued project-scoped token. `toloka whoami` reports which platform and which credential source is in effect, and exits non-zero when the platform is unreachable.
104
-
105
- ## The browser login expired
106
-
107
- ```
108
- Your browser login for https://platform.toloka.ai has expired.
109
- ```
110
-
111
- A browser session renews itself for up to 14 days after signing in, or 8 days without use. Run `toloka login` again.
112
-
113
- ## Authentication fails with a key you just generated
114
-
115
- Keys are scoped to the platform that issued them. A key from one platform's console will not authenticate against a different platform. `whoami` prints the base URL it is using; confirm it matches the console where the key was generated. The same holds for browser logins: `ENV=prestable toloka login` signs in to the testing login service, and a production login does not serve prestable.