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 25238cb
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: config-registry.mdx
+9-21Lines changed: 9 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: "Find browser and proxy settings that can reach the site you want t
5
5
6
6
**status:** <Badgecolor="yellow">preview</Badge>
7
7
8
-
give the config registry a public url and it returns browser and proxy settings that have worked for that site. if we don't have a recommendation yet, you can start an analysis against the live site and poll for the result.
8
+
give the config registry a public url and it returns browser and proxy settings that have worked for that site. if we don't have a recommendation yet, you can start an analysis against the live site and wait for the result.
9
9
10
10
recommendations are advisory. you decide whether to use them, and <spanclassName="kernel-brand-name">KERNEL</span> won't create a browser or proxy until you ask it to.
11
11
@@ -44,7 +44,7 @@ a null `recommendation` means the registry doesn't have a usable answer for this
44
44
45
45
### 2. run an analysis when needed
46
46
47
-
`resolve` starts an analysis or joins one already running for the same url. analysis usually takes several minutes. the initial response has a null `recommendation`, so poll the returned analysis id until its status is no longer `running`.
47
+
`resolve` starts an analysis or joins one already running for the same url. analysis usually takes several minutes. the initial response has a null `recommendation`, so pass the returned analysis id to the sdk waiter.
48
48
49
49
<CodeGroup>
50
50
@@ -53,11 +53,7 @@ const started = await kernel.configRegistry.resolve({
const result =awaitkernel.configRegistry.analyses.waitForResult(started.analysis!.id);
61
57
62
58
if (result.recommendation?.type==='recommendation') {
63
59
console.log(result.recommendation);
@@ -69,10 +65,7 @@ if (result.recommendation?.type === 'recommendation') {
69
65
```python Python
70
66
started = kernel.config_registry.resolve(url="https://www.kernel.sh/docs")
71
67
72
-
result = started
73
-
while result.analysis and result.analysis.status =="running":
74
-
time.sleep(5)
75
-
result = kernel.config_registry.analyses.retrieve(started.analysis.id)
68
+
result = kernel.config_registry.analyses.wait_for_result(started.analysis.id)
76
69
77
70
if result.recommendation and result.recommendation.type =="recommendation":
78
71
print(result.recommendation)
@@ -82,6 +75,8 @@ else:
82
75
83
76
</CodeGroup>
84
77
78
+
the waiters poll every five seconds by default. use `maxWaitMs` in typescript or `max_wait_seconds` in python to bound the local wait. timing out stops waiting but doesn't cancel the analysis.
79
+
85
80
the terminal analysis statuses are `completed`, `failed`, `canceled`, and `expired`. when an analysis finishes without a recommendation, inspect `recommendation` and `analysis.failure` for the reason and retry guidance.
86
81
87
82
### 3. create a browser with the recommendation
@@ -146,7 +141,7 @@ the dashboard generates equivalent typescript, python, and cli snippets for each
146
141
| method | use it when | behavior |
147
142
| --- | --- | --- |
148
143
|`lookup`| you want the best answer already in the registry | returns immediately, doesn't start work, and always reflects current knowledge |
149
-
|`resolve`|`lookup` returned null or you want fresh evidence | starts or joins an analysis and returns an analysis id to poll|
144
+
|`resolve`|`lookup` returned null or you want fresh evidence | starts or joins an analysis and returns an analysis id to pass to the sdk waiter|
150
145
151
146
a completed analysis is a stable historical record. retrieving its id always returns what that run concluded, even after later analyses produce new knowledge. use `lookup` when you want the latest recommendation instead.
152
147
@@ -200,11 +195,7 @@ an analysis may also return short guidance based on what it observed while navig
0 commit comments