Skip to content

Commit 0cae05d

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feat/Support_granting_records_credit_budgets
2 parents ade5fd6 + 64d7a89 commit 0cae05d

31 files changed

Lines changed: 973 additions & 161 deletions

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
# CasualOS Changelog
22

3-
## V4.2.4
3+
## V4.2.6
44

55
#### Date: TBD
66

7+
### :bug: Bug Fixes
8+
9+
- Fixed an issue where Anthropic models might under-report credit usage when streaming chat messages.
10+
11+
## V4.2.5
12+
13+
#### Date: 6/10/2026
14+
15+
### :bug: Bug Fixes
16+
17+
- Fixed an issue where getting a package version required that the user be logged in.
18+
- Fixed an issue where `os.createRecord()` did not work.
19+
20+
## V4.2.4
21+
22+
#### Date: 5/16/2026
23+
724
### :boom: Breaking Changes
825

926
- Changed how whitespace is handled in JSX expressions by default.
@@ -57,6 +74,15 @@
5774
- Supports filtering by `minTimeMs`, `maxTimeMs`, and `limit`.
5875
- Added the `allow-popups-to-escape-sandbox` option to the VM sandbox so that they can link to new browsing contexts.
5976
- Added the `language-model` option to the VM iframe permission policy.
77+
- Made [`for await...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) loop iterations not use energy.
78+
- These kinds of loops work asynchronously, so they aren't likely to cause the system to lock up due to an infinite loop.
79+
- Added the `"-energy";` directive to disable energy checks for a script.
80+
- Added the `getPublicInstOptions` procedure for retrieving public inst lifetime configuration.
81+
- Returns the configured `publicInstRecordsLifetimeSeconds` and `publicInstRecordsLifetimeExpireMode` values from Redis server options.
82+
- Does not require authentication (available to logged-out users).
83+
- Updated the player BIOS to display public/free inst retention duration.
84+
- The player now reads `getPublicInstOptions.lifetimeSeconds` and shows the duration in the BIOS option label (for example: `free 24h` or `free 45m`).
85+
- If public inst options are unavailable, the BIOS falls back to the plain option label.
6086
- Added support for record-level credit billing accounts.
6187
- Records can now be configured with a dedicated credit account budget for metered usage.
6288
- AI, data, and file usage billing now supports charging a record-level credit account when configured.
@@ -66,6 +92,7 @@
6692
- Fixed an issue where the default page title contained HTML comments used for replacing it on server-based deployments.
6793
- Fixed an issue where fractional `tokenModifierRatio` values could cause the server to error because of mishandling of fractional values for AI chat billing.
6894
- Fixed an issue where Anthropic models would not be allowed to output more than `4096` tokens.
95+
- Fixed an issue where the `inst` tag on the `configBot` wouldn't be properly populated for insts loaded via `os.loadInst(config)`.
6996

7097
## V4.2.3
7198

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"packages": [
33
"src/*"
44
],
5-
"version": "4.2.3",
5+
"version": "4.2.5",
66
"npmClient": "pnpm"
77
}

pnpm-lock.yaml

Lines changed: 39 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/aux-components/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@casual-simulation/aux-components",
3-
"version": "4.2.3",
3+
"version": "4.2.5",
44
"description": "Common library for AUX Vue components and Misc",
55
"main": "index.js",
66
"types": "index.d.ts",
@@ -34,11 +34,11 @@
3434
},
3535
"dependencies": {
3636
"@casual-simulation/aux-common": "^4.2.3",
37-
"@casual-simulation/aux-vm": "^4.2.3",
38-
"@casual-simulation/aux-vm-browser": "^4.2.3",
39-
"@casual-simulation/aux-vm-client": "^4.2.3",
40-
"@casual-simulation/aux-vm-deno": "^4.2.3",
41-
"@casual-simulation/aux-vm-node": "^4.2.3",
37+
"@casual-simulation/aux-vm": "^4.2.5",
38+
"@casual-simulation/aux-vm-browser": "^4.2.5",
39+
"@casual-simulation/aux-vm-client": "^4.2.5",
40+
"@casual-simulation/aux-vm-deno": "^4.2.5",
41+
"@casual-simulation/aux-vm-node": "^4.2.5",
4242
"@casual-simulation/crypto": "^4.0.5",
4343
"@casual-simulation/crypto-browser": "^4.0.5",
4444
"@casual-simulation/crypto-node": "^4.0.5",

src/aux-records-aws/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@casual-simulation/aux-records-aws",
3-
"version": "4.2.3",
3+
"version": "4.2.5",
44
"description": "AWS Store implementations for the CasualOS Records System.",
55
"keywords": [],
66
"author": "Casual Simulation, Inc.",
@@ -45,7 +45,7 @@
4545
"@aws-sdk/credential-providers": "^3.620.1",
4646
"@aws-sdk/types": "^3.609.0",
4747
"@casual-simulation/aux-common": "^4.2.3",
48-
"@casual-simulation/aux-records": "^4.2.3",
48+
"@casual-simulation/aux-records": "^4.2.5",
4949
"axios": "1.7.7",
5050
"uuid": "10.0.0"
5151
}

src/aux-records/AnthropicAIChatInterface.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,31 @@ export class AnthropicAIChatInterface implements AIChatInterface {
168168
anthropic: chunk,
169169
};
170170
}
171+
} else if (chunk.type === 'content_block_start') {
172+
if (chunk.content_block.type === 'text') {
173+
yield {
174+
choices: [
175+
{
176+
content: chunk.content_block.text,
177+
role: 'assistant',
178+
anthropic: chunk,
179+
},
180+
],
181+
totalTokens: 0,
182+
anthropic: chunk,
183+
};
184+
}
185+
} else if ('usage' in chunk) {
186+
// Chunck has usage info
187+
yield {
188+
choices: [],
189+
totalTokens:
190+
chunk.usage.input_tokens +
191+
chunk.usage.output_tokens,
192+
inputTokens: chunk.usage.input_tokens,
193+
outputTokens: chunk.usage.output_tokens,
194+
anthropic: chunk,
195+
};
171196
}
172197
}
173198

src/aux-records/RecordsController.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4627,6 +4627,27 @@ describe('RecordsController', () => {
46274627
]);
46284628
});
46294629

4630+
it('should create the given record for the user if no ownerId is provided', async () => {
4631+
const result = await manager.createRecord({
4632+
recordName: 'myRecord',
4633+
userId: 'userId',
4634+
});
4635+
4636+
expect(result).toEqual({
4637+
success: true,
4638+
});
4639+
4640+
const records = await store.listRecordsByOwnerId('userId');
4641+
4642+
expect(records).toEqual([
4643+
{
4644+
name: 'myRecord',
4645+
ownerId: 'userId',
4646+
studioId: null,
4647+
},
4648+
]);
4649+
});
4650+
46304651
it('should not create the record if it already exists', async () => {
46314652
await store.addRecord({
46324653
name: 'myRecord',

0 commit comments

Comments
 (0)