| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(workbot): run computers through a flagged Differently sandbox gateway (#6649) * feat(sandbox): run Workbot computers through a self-hosted Differently control plane Add @openwork/sandbox-differently, an adapter for the shared sandbox contract backed by Differently's API. A runner holds one project-scoped Differently key; Differently holds the OpenSandbox, Daytona and Freestyle credentials and decides by policy where each computer runs. HEADLESS_COMPUTER=differently turns it on for one runner, with DIFFERENTLY_URL, DIFFERENTLY_API_KEY and HEADLESS_COMPUTER_SNAPSHOT as a Differently template. It stays off by default. The adapter passes the shared provider and block conformance cases against an in-memory Differently, and CI runs them with the other adapters. Signed-off-by: Jalil <reachjalil@gmail.com> * fix(sandbox): trim trailing slashes without a backtracking pattern CodeQL flagged /\/+$/ on caller-supplied URLs and paths as a polynomial regular expression. Trim with a linear loop instead. Signed-off-by: Jalil <reachjalil@gmail.com> * feat(workbot): run computers through a flagged sandbox gateway Differently is now a sandbox gateway with its own runner settings (SANDBOX_GATEWAY, SANDBOX_GATEWAY_URL, SANDBOX_GATEWAY_API_KEY, SANDBOX_GATEWAY_TEMPLATE) instead of a HEADLESS_COMPUTER provider. HEADLESS_COMPUTER stays off, freestyle or daytona. The per-organization sandboxGateway flag reaches the runner as a session setting. Flagged conversations run their computer through the gateway; the rest keep the runner's own provider. With the flag on and no gateway configured, the runner logs it and keeps its own provider; a configured gateway that fails is never bypassed. Older runners drop the setting and keep the conversation. Signed-off-by: Jalil <reachjalil@gmail.com> * feat(workbot): fall back from an unhealthy sandbox gateway A gateway conversation's computer is now placed when one is first needed: through the gateway while a cached health check (Differently's capabilities, an enabled healthy pool) passes, otherwise, or when the gateway cannot start it for infrastructure reasons, on the runner's own provider. The gateway's refusals still fail the call instead of being routed around, and conversations without the flag never use it. The runner records which side made each computer, keeps a computer where it was made, and moves a fallback conversation back through the gateway once its fallback computer is gone. A sandbox that failed to start is now a transient error rather than a capacity refusal. Signed-off-by: Jalil <reachjalil@gmail.com> * fix(workbot): size gateway computers and idle them as the pools allow Computers made through the sandbox gateway now ask for the same size as Daytona's instead of the gateway project's default profile. The Differently adapter reads what its enabled pools can do alongside each create (at most every five minutes) and stops claiming pause or stop where they can't, so idle computers on those pools keep running until their TTL instead of failing to pause. Signed-off-by: Jalil <reachjalil@gmail.com> * test(workbot): prove gateway computers on pools that cannot pause Signed-off-by: Jalil <reachjalil@gmail.com> * fix(workbot): stop gateway computers on pools that can stop but not pause The pause block's presence is copied by provider wrappers before the pools' lifecycle is discovered, so on pools that list stop-start but not pause-resume the adapter's pause now stops the sandbox (keeping its disk) instead of refusing. Signed-off-by: Jalil <reachjalil@gmail.com> --------- Signed-off-by: Jalil <reachjalil@gmail.com> | 3 天前 | |
feat(workbot): run computers through a flagged Differently sandbox gateway (#6649) * feat(sandbox): run Workbot computers through a self-hosted Differently control plane Add @openwork/sandbox-differently, an adapter for the shared sandbox contract backed by Differently's API. A runner holds one project-scoped Differently key; Differently holds the OpenSandbox, Daytona and Freestyle credentials and decides by policy where each computer runs. HEADLESS_COMPUTER=differently turns it on for one runner, with DIFFERENTLY_URL, DIFFERENTLY_API_KEY and HEADLESS_COMPUTER_SNAPSHOT as a Differently template. It stays off by default. The adapter passes the shared provider and block conformance cases against an in-memory Differently, and CI runs them with the other adapters. Signed-off-by: Jalil <reachjalil@gmail.com> * fix(sandbox): trim trailing slashes without a backtracking pattern CodeQL flagged /\/+$/ on caller-supplied URLs and paths as a polynomial regular expression. Trim with a linear loop instead. Signed-off-by: Jalil <reachjalil@gmail.com> * feat(workbot): run computers through a flagged sandbox gateway Differently is now a sandbox gateway with its own runner settings (SANDBOX_GATEWAY, SANDBOX_GATEWAY_URL, SANDBOX_GATEWAY_API_KEY, SANDBOX_GATEWAY_TEMPLATE) instead of a HEADLESS_COMPUTER provider. HEADLESS_COMPUTER stays off, freestyle or daytona. The per-organization sandboxGateway flag reaches the runner as a session setting. Flagged conversations run their computer through the gateway; the rest keep the runner's own provider. With the flag on and no gateway configured, the runner logs it and keeps its own provider; a configured gateway that fails is never bypassed. Older runners drop the setting and keep the conversation. Signed-off-by: Jalil <reachjalil@gmail.com> * feat(workbot): fall back from an unhealthy sandbox gateway A gateway conversation's computer is now placed when one is first needed: through the gateway while a cached health check (Differently's capabilities, an enabled healthy pool) passes, otherwise, or when the gateway cannot start it for infrastructure reasons, on the runner's own provider. The gateway's refusals still fail the call instead of being routed around, and conversations without the flag never use it. The runner records which side made each computer, keeps a computer where it was made, and moves a fallback conversation back through the gateway once its fallback computer is gone. A sandbox that failed to start is now a transient error rather than a capacity refusal. Signed-off-by: Jalil <reachjalil@gmail.com> * fix(workbot): size gateway computers and idle them as the pools allow Computers made through the sandbox gateway now ask for the same size as Daytona's instead of the gateway project's default profile. The Differently adapter reads what its enabled pools can do alongside each create (at most every five minutes) and stops claiming pause or stop where they can't, so idle computers on those pools keep running until their TTL instead of failing to pause. Signed-off-by: Jalil <reachjalil@gmail.com> * test(workbot): prove gateway computers on pools that cannot pause Signed-off-by: Jalil <reachjalil@gmail.com> * fix(workbot): stop gateway computers on pools that can stop but not pause The pause block's presence is copied by provider wrappers before the pools' lifecycle is discovered, so on pools that list stop-start but not pause-resume the adapter's pause now stops the sandbox (keeping its disk) instead of refusing. Signed-off-by: Jalil <reachjalil@gmail.com> --------- Signed-off-by: Jalil <reachjalil@gmail.com> | 3 天前 | |
feat(workbot): run computers through a flagged Differently sandbox gateway (#6649) * feat(sandbox): run Workbot computers through a self-hosted Differently control plane Add @openwork/sandbox-differently, an adapter for the shared sandbox contract backed by Differently's API. A runner holds one project-scoped Differently key; Differently holds the OpenSandbox, Daytona and Freestyle credentials and decides by policy where each computer runs. HEADLESS_COMPUTER=differently turns it on for one runner, with DIFFERENTLY_URL, DIFFERENTLY_API_KEY and HEADLESS_COMPUTER_SNAPSHOT as a Differently template. It stays off by default. The adapter passes the shared provider and block conformance cases against an in-memory Differently, and CI runs them with the other adapters. Signed-off-by: Jalil <reachjalil@gmail.com> * fix(sandbox): trim trailing slashes without a backtracking pattern CodeQL flagged /\/+$/ on caller-supplied URLs and paths as a polynomial regular expression. Trim with a linear loop instead. Signed-off-by: Jalil <reachjalil@gmail.com> * feat(workbot): run computers through a flagged sandbox gateway Differently is now a sandbox gateway with its own runner settings (SANDBOX_GATEWAY, SANDBOX_GATEWAY_URL, SANDBOX_GATEWAY_API_KEY, SANDBOX_GATEWAY_TEMPLATE) instead of a HEADLESS_COMPUTER provider. HEADLESS_COMPUTER stays off, freestyle or daytona. The per-organization sandboxGateway flag reaches the runner as a session setting. Flagged conversations run their computer through the gateway; the rest keep the runner's own provider. With the flag on and no gateway configured, the runner logs it and keeps its own provider; a configured gateway that fails is never bypassed. Older runners drop the setting and keep the conversation. Signed-off-by: Jalil <reachjalil@gmail.com> * feat(workbot): fall back from an unhealthy sandbox gateway A gateway conversation's computer is now placed when one is first needed: through the gateway while a cached health check (Differently's capabilities, an enabled healthy pool) passes, otherwise, or when the gateway cannot start it for infrastructure reasons, on the runner's own provider. The gateway's refusals still fail the call instead of being routed around, and conversations without the flag never use it. The runner records which side made each computer, keeps a computer where it was made, and moves a fallback conversation back through the gateway once its fallback computer is gone. A sandbox that failed to start is now a transient error rather than a capacity refusal. Signed-off-by: Jalil <reachjalil@gmail.com> * fix(workbot): size gateway computers and idle them as the pools allow Computers made through the sandbox gateway now ask for the same size as Daytona's instead of the gateway project's default profile. The Differently adapter reads what its enabled pools can do alongside each create (at most every five minutes) and stops claiming pause or stop where they can't, so idle computers on those pools keep running until their TTL instead of failing to pause. Signed-off-by: Jalil <reachjalil@gmail.com> * test(workbot): prove gateway computers on pools that cannot pause Signed-off-by: Jalil <reachjalil@gmail.com> * fix(workbot): stop gateway computers on pools that can stop but not pause The pause block's presence is copied by provider wrappers before the pools' lifecycle is discovered, so on pools that list stop-start but not pause-resume the adapter's pause now stops the sandbox (keeping its disk) instead of refusing. Signed-off-by: Jalil <reachjalil@gmail.com> --------- Signed-off-by: Jalil <reachjalil@gmail.com> | 3 天前 | |
feat(workbot): run computers through a flagged Differently sandbox gateway (#6649) * feat(sandbox): run Workbot computers through a self-hosted Differently control plane Add @openwork/sandbox-differently, an adapter for the shared sandbox contract backed by Differently's API. A runner holds one project-scoped Differently key; Differently holds the OpenSandbox, Daytona and Freestyle credentials and decides by policy where each computer runs. HEADLESS_COMPUTER=differently turns it on for one runner, with DIFFERENTLY_URL, DIFFERENTLY_API_KEY and HEADLESS_COMPUTER_SNAPSHOT as a Differently template. It stays off by default. The adapter passes the shared provider and block conformance cases against an in-memory Differently, and CI runs them with the other adapters. Signed-off-by: Jalil <reachjalil@gmail.com> * fix(sandbox): trim trailing slashes without a backtracking pattern CodeQL flagged /\/+$/ on caller-supplied URLs and paths as a polynomial regular expression. Trim with a linear loop instead. Signed-off-by: Jalil <reachjalil@gmail.com> * feat(workbot): run computers through a flagged sandbox gateway Differently is now a sandbox gateway with its own runner settings (SANDBOX_GATEWAY, SANDBOX_GATEWAY_URL, SANDBOX_GATEWAY_API_KEY, SANDBOX_GATEWAY_TEMPLATE) instead of a HEADLESS_COMPUTER provider. HEADLESS_COMPUTER stays off, freestyle or daytona. The per-organization sandboxGateway flag reaches the runner as a session setting. Flagged conversations run their computer through the gateway; the rest keep the runner's own provider. With the flag on and no gateway configured, the runner logs it and keeps its own provider; a configured gateway that fails is never bypassed. Older runners drop the setting and keep the conversation. Signed-off-by: Jalil <reachjalil@gmail.com> * feat(workbot): fall back from an unhealthy sandbox gateway A gateway conversation's computer is now placed when one is first needed: through the gateway while a cached health check (Differently's capabilities, an enabled healthy pool) passes, otherwise, or when the gateway cannot start it for infrastructure reasons, on the runner's own provider. The gateway's refusals still fail the call instead of being routed around, and conversations without the flag never use it. The runner records which side made each computer, keeps a computer where it was made, and moves a fallback conversation back through the gateway once its fallback computer is gone. A sandbox that failed to start is now a transient error rather than a capacity refusal. Signed-off-by: Jalil <reachjalil@gmail.com> * fix(workbot): size gateway computers and idle them as the pools allow Computers made through the sandbox gateway now ask for the same size as Daytona's instead of the gateway project's default profile. The Differently adapter reads what its enabled pools can do alongside each create (at most every five minutes) and stops claiming pause or stop where they can't, so idle computers on those pools keep running until their TTL instead of failing to pause. Signed-off-by: Jalil <reachjalil@gmail.com> * test(workbot): prove gateway computers on pools that cannot pause Signed-off-by: Jalil <reachjalil@gmail.com> * fix(workbot): stop gateway computers on pools that can stop but not pause The pause block's presence is copied by provider wrappers before the pools' lifecycle is discovered, so on pools that list stop-start but not pause-resume the adapter's pause now stops the sandbox (keeping its disk) instead of refusing. Signed-off-by: Jalil <reachjalil@gmail.com> --------- Signed-off-by: Jalil <reachjalil@gmail.com> | 3 天前 |