Repository navigation
feat(daemon): the runtime owns its state and never the process #3772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thymikee
wants to merge
13
commits into
refactor/host-environment
from
refactor/daemon-runtime-no-process-globals
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
05be6bf
feat(daemon): the runtime reports its shutdown instead of exiting the…
thymikee 5789838
feat(daemon): per-runtime state for admission, resolution, artifacts,…
thymikee 9793a87
feat(daemon): per-runtime Apple runner state and a shared PNG worker
thymikee 0b83711
chore(daemon): drop re-exports nothing consumes yet
thymikee c3baaec
fix(daemon): a failed shutdown step releases the rest, and dispose re…
thymikee c047776
fix(daemon): assert registration release on a failed close and share …
thymikee 22cea00
fix(apple): scope start admissions, prep builds and bad-artifact mark…
thymikee 5c98812
refactor(move): keep daemon-runtime.ts under the size limit
thymikee 817930f
chore: merge the host environment foundation into the runtime state b…
thymikee 012b50d
Merge branch 'refactor/host-environment' into refactor/daemon-runtime…
thymikee 2f29e99
test: drop the empty daemon-runtime imports left by the runtime-state…
thymikee 5b26ca3
Merge remote-tracking branch 'origin/refactor/host-environment' into …
thymikee 7eedaf6
test: run the Limrun public HTTP test on the runtime shutdown contract
thymikee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import fs from 'node:fs'; | ||
| import path from 'node:path'; | ||
| import { expect, test } from 'vitest'; | ||
| import { mkdtempForTestSync } from '@agent-device/test-kit'; | ||
| import { | ||
| createArtifactTrackingRuntimeState, | ||
| trackDownloadableArtifact, | ||
| trackUploadedArtifact, | ||
| } from './artifact-tracking.ts'; | ||
|
|
||
| test('disposing a runtime removes the temporary files it still tracks', () => { | ||
| const root = mkdtempForTestSync('agent-device-artifact-dispose-'); | ||
| const artifactPath = path.join(root, 'artifact.txt'); | ||
| const uploadDir = path.join(root, 'upload'); | ||
| fs.writeFileSync(artifactPath, 'artifact'); | ||
| fs.mkdirSync(uploadDir); | ||
| fs.writeFileSync(path.join(uploadDir, 'payload'), 'payload'); | ||
| const runtime = createArtifactTrackingRuntimeState(); | ||
|
|
||
| runtime.run(() => { | ||
| trackDownloadableArtifact({ | ||
| artifactPath, | ||
| artifactType: 'runtime-artifact', | ||
| fileName: 'artifact.txt', | ||
| }); | ||
| trackUploadedArtifact({ artifactPath: path.join(uploadDir, 'payload'), tempDir: uploadDir }); | ||
| }); | ||
| runtime.dispose(); | ||
|
|
||
| expect(fs.existsSync(uploadDir)).toBe(false); | ||
| expect(fs.existsSync(artifactPath)).toBe(false); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.