Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
7b2b23f
test(security): remove unused DocumentStore import from native fixture
senamakel Nov 11, 2026
bfdfd32
chore(security): add temporary debug logging to approval callbacks
senamakel Nov 11, 2026
9b4c0f1
fix(security): raise default secret in-flight limit to 32
senamakel Nov 11, 2026
dac4391
fix(security): use default secret limits for module config
senamakel Nov 11, 2026
6936d3b
chore(security): remove leftover debug logging from approval paths
senamakel Nov 11, 2026
74c6c38
test(security): cover concurrent tenant secret unlocks
senamakel Nov 11, 2026
300f898
fix(security): raise secret max in-flight limit to 32
senamakel Nov 11, 2026
8aca950
chore(security): add debug logging to security callback loading
senamakel Nov 11, 2026
d1d4e50
chore(security): remove debug logging and fix test profile setup
senamakel Nov 11, 2026
c263227
test(profiles): assert the credentials fixture has its policy directo…
senamakel Nov 11, 2026
8a5b117
test: reformat assertions to satisfy line width limits
senamakel Nov 11, 2026
beac0ae
chore(ci): update saas ambient baseline
senamakel Nov 11, 2026
fd29fe9
test(core): cover structured codes surviving session failure rewrites
senamakel Nov 11, 2026
83a9012
test(inference): add managed embedding inspection tests
senamakel Nov 11, 2026
6ad7cac
test(inference): register inspection tests for managed embedding
senamakel Nov 11, 2026
5d31b0b
feat(media): enforce TinySecurity protected-path floor for local refe…
senamakel Nov 11, 2026
d60bbc0
fix(core): preserve structured rpc error data on session failure repl…
senamakel Nov 11, 2026
17febc9
test(doctor): cover managed embeddings live probe paths
senamakel Nov 11, 2026
51a6550
test(media): assert refusal reason for protected windows paths
senamakel Nov 11, 2026
83b5fb5
test(media): tighten windows root policy assertion
senamakel Nov 11, 2026
24a34c3
test(embed): add debug output when provisioning alice fails
senamakel Nov 11, 2026
3b75c22
fix(inference): widen enforce_local_only_inference visibility to crate
senamakel Nov 11, 2026
078f27a
feat(embedding): enforce local-only check in inspection embedding fac…
senamakel Nov 11, 2026
9d344a0
test(embed): remove leftover debug logging from saas profiles test
senamakel Nov 11, 2026
56c1708
fix(media): enforce protected-path floor on reference files
senamakel Nov 11, 2026
57f57e3
test(inference): drop removed argument from managed embedding tests
senamakel Nov 11, 2026
a8a9d45
refactor(tinyhumans): split managed embedding model construction from…
senamakel Nov 11, 2026
da35f8d
chore: apply rustfmt formatting and document doctor embedding probe
senamakel Nov 11, 2026
cc2fc55
docs(media): document async tool entry point and protected floor
senamakel Nov 11, 2026
da2d211
test(security): add tests for saas grant approval gate
senamakel Nov 11, 2026
b0cd0b6
test(approval): add stub label accessor and register saas grant tests
senamakel Nov 11, 2026
3d21f0d
feat(security): add saas grant approval gate
senamakel Nov 11, 2026
baa1ae6
feat(security): include saas grant module in approval gate
senamakel Nov 11, 2026
5756677
docs(doctor): document live probe credential and privacy behaviour
senamakel Nov 11, 2026
1a3cd16
ci: install pinned rust toolchain before container lanes
senamakel Nov 11, 2026
da1d747
feat(approval): let saas host authorise a tenant's own secret master …
senamakel Nov 11, 2026
649a1ad
refactor(security): extract saas host grant decision into helper
senamakel Nov 11, 2026
d4fc87e
refactor(security): reformat saas approval gate calls
senamakel Nov 11, 2026
9a1b0e4
refactor(tinyhumans): build managed embedder from call context
senamakel Nov 11, 2026
ca5f306
test(inference): cover managed bearer reading config-stored session
senamakel Nov 11, 2026
c8743f4
test(inference): cover managed embedder reading config-stored session
senamakel Nov 11, 2026
de63e7d
test(saas_mode_e2e): write core stderr to a fixed scratchpad log
senamakel Nov 11, 2026
6fea4de
test(inference): import approval chat context in managed embedding tests
senamakel Nov 11, 2026
714764c
feat(credentials): add for_state_dir to resolve the owning config's s…
senamakel Nov 11, 2026
0f20d35
feat(credentials): add helper to resolve owning embedder config
senamakel Nov 11, 2026
9bda43b
refactor(credentials): reuse shared owner lookup for api key service
senamakel Nov 11, 2026
15fbde8
docs(credentials): remove stale doc link from for_state_dir comment
senamakel Nov 11, 2026
4c9139b
test(saas_mode_e2e): capture core output in temp dir instead of scrat…
senamakel Nov 11, 2026
1566391
fix(tinyhumans): resolve managed session bearer through config-bound …
senamakel Nov 11, 2026
53f1fd4
test(inference): cover bearer isolation between credential directories
senamakel Nov 11, 2026
24bfbd3
fix(credentials): always use config when constructing auth service
senamakel Nov 11, 2026
c520cb2
fix(credentials): restore state dir ownership check in auth service
senamakel Nov 11, 2026
7a393d8
test(inference): collapse multi-line assert into single line
senamakel Nov 11, 2026
39fc298
feat(security): expose thread-local privacy override behind test feature
senamakel Nov 11, 2026
0b5e928
chore(security): mark test privacy guard as must_use
senamakel Nov 11, 2026
33e1b68
test(inference): pin privacy mode in managed embedding inspection tests
senamakel Nov 11, 2026
1b19b02
test(inference): relax egress guard assertion to match both refusal p…
senamakel Nov 11, 2026
705a64a
test: bump pinned tinysearch version to 0.5.7 in e2e harness
senamakel Nov 11, 2026
4c5f358
Merge origin/main into hosted-ci-followups
senamakel Nov 11, 2026
8a269c1
chore(ci): track separate openshell and agent37 box registries
senamakel Nov 11, 2026
8b67888
chore(ci): refresh saas ambient baseline entries
senamakel Nov 11, 2026
72a6501
test(sandbox): pass backend argument in module support test
senamakel Nov 11, 2026
aeb0a5d
test(security): isolate concurrent tenant keyring namespaces per run
senamakel Nov 11, 2026
e3a3e7a
test(doctor): cover local-only config refusing managed probe without …
senamakel Nov 11, 2026
b8e5239
fix(credentials): read encrypted api keys through the owning config
senamakel Nov 11, 2026
0b5b015
test(media): cover path alias resolution in reference policy
senamakel Nov 11, 2026
7989085
test(media): verify refused references are logged without their path
senamakel Nov 11, 2026
6e05e94
test(approval): cover dropped host grants cancelling pending requests
senamakel Nov 11, 2026
7008fbd
docs(security): document saas secret master grant approval flow
senamakel Nov 11, 2026
a50b50e
fix(security): propagate core context into prompt injection scan task
senamakel Nov 11, 2026
8d5758d
fix(inference): enforce local-only mode from selected config during i…
senamakel Nov 11, 2026
7a67baa
fix(credentials): bind api key store to caller's owning config
senamakel Nov 11, 2026
1c9efce
fix(security): cancel dropped host grant requests
senamakel Nov 11, 2026
fae928e
chore(approval): clarify guard disarm comment in saas grant gate
senamakel Nov 11, 2026
311300a
docs(profiles): document host-approved tenant secret master grant
senamakel Nov 11, 2026
dd89762
refactor(security): split protected path lookup from config loading
senamakel Nov 11, 2026
fcb8aeb
feat(security): add synchronous protected path check for host seams
senamakel Nov 11, 2026
5bf758c
fix(media): check reference paths against TinySecurity per path
senamakel Nov 11, 2026
be93889
docs(media): document resolved-path floor checks for local references
senamakel Nov 11, 2026
a33ea2d
fix(media): treat unresolvable reference paths as lexically normalized
senamakel Nov 11, 2026
02a051a
test(media): cover tinysecurity path checks in reference policy
senamakel Nov 11, 2026
4508ae8
test(tools): add wallet tool names to core tool fixtures
senamakel Nov 11, 2026
dba9787
chore(security): add temporary diagnostic logging to failure paths
senamakel Nov 11, 2026
626cc0f
fix(approval): report closure reason when a closed scope fails its check
senamakel Nov 11, 2026
670d536
chore(security): add diagnostic logging to audit sink append
senamakel Nov 11, 2026
73a9c04
test: isolate file storage tests from the runner's home config
senamakel Nov 11, 2026
04a7d28
test(openai_oauth): read rotated profile through config-bound store
senamakel Nov 11, 2026
a246dfa
test(credentials): disable modules to force keyring unavailability
senamakel Nov 11, 2026
dd87be8
style: apply rustfmt formatting to security and media tests
senamakel Nov 11, 2026
75766ad
fix(security): raise secret operations per minute limit to 4096
senamakel Nov 11, 2026
dc2c5c5
test(embed): assert unknown tool calls surface recoverable errors
senamakel Nov 11, 2026
c9f084e
test(tinyhumans): isolate test process workspace
senamakel Nov 11, 2026
236484f
test(security): cover secret authority rate for busy runtimes
senamakel Nov 11, 2026
022338f
feat(security): add host grant approval gate
senamakel Nov 11, 2026
86b6a9d
fix(security): allow library hosts to authorise secret grants without…
senamakel Nov 11, 2026
6e2cb93
fix(embed): authorise host-supplied api key storage through the appro…
senamakel Nov 11, 2026
0ec918d
feat(embed): add boot test for API key handling
senamakel Nov 11, 2026
cf5dcbe
chore(embed): drop redundant secret grant call in api key store
senamakel Nov 11, 2026
919b848
test(file_storage): isolate workspace in tool tests
senamakel Nov 11, 2026
483ccaf
fix(embed): route secret grants and unknown tools through the securit…
senamakel Nov 11, 2026
659b298
fix(approval): rename host grant session prefix to session
senamakel Nov 11, 2026
5cf772b
test(embed): assert tool error via parsed tool messages
senamakel Nov 11, 2026
9496c48
test(embed): log tool results before asserting refusal
senamakel Nov 11, 2026
07c2ea9
test(embed): assert capability-hook refusal messages in profile tests
senamakel Nov 11, 2026
bf3598d
test(embed): assert operator callback denial surfaces as tool error
senamakel Nov 11, 2026
2e23a84
test(approval): register host grant test module
senamakel Nov 11, 2026
dabad7d
test(credentials): add diagnostics to session clear key assertion
senamakel Nov 11, 2026
5fc75e6
feat(approval): add stub hook to delay decide and route decisions thr…
senamakel Nov 11, 2026
24b0600
fix(approval): clone gate handle before moving it into the decision task
senamakel Nov 11, 2026
a915d0f
test(approval): register rpc decide test module
senamakel Nov 11, 2026
8a1cd89
test(security_approval): decide parked approvals off the runtime thread
senamakel Nov 11, 2026
39df0f9
fix(security): run approval decisions off the caller runtime
senamakel Nov 11, 2026
e70386f
test(embed): wait for ephemeral workspace removal instead of assertin…
senamakel Nov 11, 2026
a044b58
test(credentials): simplify session clear key assertion
senamakel Nov 11, 2026
88739e6
fix(security): drop context propagation from prompt scan
senamakel Nov 11, 2026
907f19b
fix(security): propagate caller context into prompt injection scan
senamakel Nov 11, 2026
2c075c1
test(session_host): add trace diagnostics to repair cancellation test
senamakel Nov 11, 2026
ebf9d1d
test(session_host): initialize debug logging in trace test
senamakel Nov 11, 2026
92e325b
test(session_host): remove trace diagnostics from runtime adapter tra…
senamakel Nov 11, 2026
e289fb8
test(session_host): raise repair-signal timeout to avoid flaky hangs
senamakel Nov 11, 2026
9b1d8c8
chore: apply rustfmt formatting to security and embed tests
senamakel Nov 11, 2026
ad5e7c8
test(profile_host_capabilities): move call tools fixture into its own…
senamakel Nov 11, 2026
939df94
test(openhuman-embed): reorder module declarations in host capabiliti…
senamakel Nov 11, 2026
1c07850
test(profile_host_capabilities): fix module paths and drop unused imp…
senamakel Nov 11, 2026
d1844a9
fix(approval): route blocking decide through ambient dispatch context
senamakel Nov 11, 2026
78fe868
chore(ci): register host-authorised secret grant in process statics
senamakel Nov 11, 2026
bef6223
refactor(security): reformat approval decision spawn_blocking call
senamakel Nov 11, 2026
81904aa
test(saas_isolation): widen log filter in eviction storm test
senamakel Nov 11, 2026
4d78972
test(saas_isolation): capture node log on storm test failure
senamakel Nov 11, 2026
1ac602d
test(saas_isolation): add diagstorm_min to reproduce single-slot evic…
senamakel Nov 11, 2026
4b81dbc
test(saas_isolation): exercise two-profile storm variant
senamakel Nov 11, 2026
51ebd96
test(scripts): add tests for install-ci-packages script
senamakel Nov 11, 2026
78ba601
feat(ci): add script to install ci packages
senamakel Nov 11, 2026
b987498
ci: install ci packages via script with mirror fallback
senamakel Nov 11, 2026
5f8d199
Merge remote-tracking branch 'origin/main' into hosted-ci-followups
senamakel Nov 11, 2026
20529b0
chore(session_host): add diagnostic field-stripping helper for ctx le…
senamakel Nov 11, 2026
ccaab24
test(saas_isolation): capture node log on successful storm request
senamakel Nov 11, 2026
762a2f1
chore(core): add diagstorm counts helper and refine strip probe
senamakel Nov 11, 2026
b57317d
style: reformat long expressions to satisfy line width limits
senamakel Nov 11, 2026
ada578e
fix(session_host): make diagstorm strip async and log tap exit
senamakel Nov 11, 2026
e0e048f
fix(web_chat): await diagstorm_strip in checkin_session_agent
senamakel Nov 11, 2026
48d1c84
chore(web_chat): reformat diagstorm_strip call chain
senamakel Nov 11, 2026
9236c1b
chore(diagstorm): defer agent strip diagnostics to a background task
senamakel Nov 11, 2026
8e2c175
chore: remove diagstorm instrumentation
senamakel Nov 11, 2026
141ab17
test(artifacts): cover tenant release for artifact tools kept past th…
senamakel Nov 11, 2026
9b649cf
fix(artifacts): hold a weak context in sandbox box files
senamakel Nov 11, 2026
1fc7f35
test(web_chat): add tenant release test module
senamakel Nov 11, 2026
3af0aed
fix(network): hold x402 payment hook context weakly to free tenant slots
senamakel Nov 11, 2026
68a497f
test(web_chat): add debug output to tenant release test
senamakel Nov 11, 2026
a18f530
test(web_chat): add temporary bisect test for tool tenant holders
senamakel Nov 11, 2026
70b2fba
test(web_chat): wait for background tenant holds to finish before ass…
senamakel Nov 11, 2026
58a21bc
test(web_chat): account for x402 tool when web3 feature is enabled
senamakel Nov 11, 2026
73e9fb9
refactor(artifacts): hold dispatch context directly in sandbox box files
senamakel Nov 11, 2026
c0f3b68
fix(artifacts): hold the dispatch context weakly in sandbox box files
senamakel Nov 11, 2026
40625ae
test(sandbox): update bus driver tests for per-call config lookup
senamakel Nov 11, 2026
b1c009a
test(sandbox): bind serve result in bus driver cleanup test
senamakel Nov 11, 2026
639bcc7
test(sandbox): add call field to box settings test fixtures
senamakel Nov 11, 2026
784f872
test(sandbox): verify each driver step receives the call it serves
senamakel Nov 11, 2026
926fb62
feat(sandbox): add BoxCall to carry per-call config through box settings
senamakel Nov 11, 2026
b3ffcaa
feat(sandbox): initialize call field to none in box settings
senamakel Nov 11, 2026
b99172d
chore(sandbox): initialize call field to none in box settings
senamakel Nov 11, 2026
ee99b00
refactor(sandbox): simplify box driver serve call sites
senamakel Nov 11, 2026
a84a108
refactor(sandbox): hoist backend settings lookup before registry crea…
senamakel Nov 11, 2026
2ce0643
refactor(sandbox): carry call config on box settings instead of task …
senamakel Nov 11, 2026
6abfbd4
test(security): cover host grant scope boundaries
senamakel Nov 11, 2026
c38412d
refactor(security): carry host secret grant on core context
senamakel Nov 11, 2026
44e1369
feat(runtime): carry host secret grants across scoped turn contexts
senamakel Nov 11, 2026
0c10f96
chore(ci): drop stale process statics entries
senamakel Nov 11, 2026
331241b
fix(sandbox): stop abandoned shell commands before releasing the turn
senamakel Nov 11, 2026
9e3c44f
style: reformat imports and chained call to satisfy rustfmt
senamakel Nov 11, 2026
e9b2ae5
test(security): reformat host grant assertions to satisfy rustfmt
senamakel Nov 11, 2026
cd65ff5
chore(sandbox): reformat long debug log line in shell exec
senamakel Nov 11, 2026
db28ef6
test(embed): compute cron fire time when the model schedules it
senamakel Nov 11, 2026
4f72a19
test(embed): reformat fire_at expectation for readability
senamakel Nov 11, 2026
b4b2b34
test(credentials): cover tenant profile storage in the configured bac…
senamakel Nov 11, 2026
1d27508
test(credentials): update tool groups import in profile storage tests
senamakel Nov 11, 2026
400d7ab
feat(credentials): add profile backend abstraction
senamakel Nov 11, 2026
2f840fc
feat(credentials): support backend leases for auth profile locking
senamakel Nov 11, 2026
762beb4
refactor(credentials): thread lock guard through profile store reads …
senamakel Nov 11, 2026
6c6ef20
feat(credentials): read and write auth profiles through backend lease
senamakel Nov 11, 2026
8c4df76
fix(credentials): read saas tenant profiles from the storage backend
senamakel Nov 11, 2026
240a3d8
feat(credentials): add backend tests for credential profiles
senamakel Nov 11, 2026
2075b4c
test(credentials): simplify redundant home resolution assertion
senamakel Nov 11, 2026
de95d95
docs(credentials): document backend-backed auth profile storage for s…
senamakel Nov 11, 2026
5ac3475
chore(profiles): clarify credential storage location and format test …
senamakel Nov 11, 2026
6229813
chore(ci): register backend profile write lock in process statics
senamakel Nov 11, 2026
642ce84
refactor(credentials): drop the tenant backend path for auth profiles
senamakel Nov 11, 2026
0c4463f
feat(credentials): add profile backend for credential storage
senamakel Nov 11, 2026
7bbae39
feat(credentials): route auth profile storage through backend leases
senamakel Nov 11, 2026
75f460a
test(tokenjuice): add deadline compaction tests
senamakel Nov 11, 2026
a4e9955
test(tokenjuice): register compact deadline test module
senamakel Nov 11, 2026
2a3c76a
fix(tokenjuice): use a short deadline for compaction without a summary
senamakel Nov 11, 2026
4dc5dec
fix(tokenjuice): use shorter compaction timeout when no summary is re…
senamakel Nov 11, 2026
ea55439
chore(inference): add debug instrumentation around tool output compac…
senamakel Nov 11, 2026
f7663bf
fix(tokenjuice): remove debug watchdog and tracing from tool output c…
senamakel Nov 11, 2026
93a80fd
chore(vendor): bump tinyagents submodule
senamakel Nov 12, 2026
f074553
chore(vendor): bump tinyagents submodule
senamakel Nov 12, 2026
0c769a5
fix(tokenjuice): drop the no-summary compaction deadline
senamakel Nov 12, 2026
818f3d4
refactor(socketio): move connect auth and rpc handlers into events mo…
senamakel Nov 12, 2026
67b2705
fix(socketio): register connect handler as a ConnectHandler tuple
senamakel Nov 12, 2026
35a5a79
refactor(socketio): simplify preflight handler and tidy comments
senamakel Nov 12, 2026
837a0f4
refactor(socketio): reindent socket event handlers
senamakel Nov 12, 2026
bfde8ad
Merge upstream main into hosted-ci-followups
senamakel Nov 12, 2026
a529e2c
chore(vendor): bump tinyagents submodule
senamakel Nov 12, 2026
7c0078a
test(cost): update catalog and budget assertions for retired models
senamakel Nov 12, 2026
e285b1b
chore(vendor): bump tinyagents submodule
senamakel Nov 12, 2026
7fcc91a
chore(vendor): move tinyagents to main with the turn-runner progress …
senamakel Nov 12, 2026
bf24828
Merge #8663 (pinned Rust toolchain install) into hosted-ci-followups
senamakel Nov 12, 2026
7222308
chore(registry): bump TinySecurity admission pins to v0.21.0
senamakel Nov 12, 2026
f1aba00
chore(security): bump tinysecurity to v0.21.0
senamakel Nov 12, 2026
d36607e
chore(deps): bump tinysecurity-bus to 0.21.0
senamakel Nov 12, 2026
8cf469e
feat(security): import undecided legacy approvals
senamakel Nov 12, 2026
1b88c7d
feat(approval): import undecided legacy requests as pending orphans
senamakel Nov 12, 2026
e2a8445
fix(security): adapt to optional credential and grant fields
senamakel Nov 12, 2026
f416194
feat(approval): surface pending orphans from earlier launches
senamakel Nov 12, 2026
c29d41e
fix(security): compare tenant against runtime Tenant default
senamakel Nov 12, 2026
bbde1fb
test(approval): cover pending legacy history import
senamakel Nov 12, 2026
befb287
refactor(approval): inline state_at into state_of
senamakel Nov 12, 2026
46c0a03
fix(security): avoid overflow when converting default approval window
senamakel Nov 12, 2026
13f38e1
test(security): update judge and keyring consent tests for optional c…
senamakel Nov 12, 2026
2669935
fix(approval): tolerate orphan listing failures and run legacy import
senamakel Nov 12, 2026
b6f52c4
test(approval): cover legacy history read from storage bridge call
senamakel Nov 12, 2026
7b5aa52
fix(approval): read legacy history on a plain os thread
senamakel Nov 12, 2026
c28e341
test(approval): cover request id preservation for imported legacy req…
senamakel Nov 12, 2026
7040d88
fix(approval): use legacy request id for imported approval entries
senamakel Nov 12, 2026
edfcb9f
chore(deps): bump tinysecurity-bus to 0.21.0
senamakel Nov 12, 2026
3305431
Merge origin/main into hosted-ci-followups
senamakel Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci-lanes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,10 @@ jobs:

- name: Install jq and unzip for release-script tests
# stage-modules.mjs unpacks module archives with unzip, which the
# image does not carry.
# image does not carry. The script falls back to another Ubuntu mirror
# when the runner cannot resolve archive.ubuntu.com.
if: matrix.container != '' && needs.plan.outputs.scripts == 'true'
run: |
apt-get update
apt-get install -y --no-install-recommends jq python3-tomli unzip
run: bash scripts/ci/install-ci-packages.sh

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority high tests likely

Commit the installer script the CI step now invokes

The `Install jq and unzip for release-script tests` step no longer runs `apt-get` inline; it invokes `scripts/ci/install-ci-packages.sh`. The changed-files list for this PR contains `scripts/ci/process-statics.json` but not `scripts/ci/install-ci-packages.sh`, and the only other reference to that path is the new unit test `scripts/__tests__/install-ci-packages.test.mjs`, which reads it from the working tree. On a fresh checkout of the merged branch the step fails with "bash: scripts/ci/install-ci-packages.sh: No such file or directory", which takes down every container lane that needs jq/tomli/unzip. Add the script to the commit, or revert the step to the inline `apt-get` invocation until it is committed.

[RULE] missing-committed-script ·


- name: Install bubblewrap for the sandbox jail
# The image's bubblewrap 0.6.1 lacks --disable-userns, so TinyBox finds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@
"update_check",
"use_skill",
"validate_workflow",
"wallet_balances",
"wallet_chain_status",
"wallet_execute_prepared",
"wallet_lookup_tx",
"wallet_prepare_transfer",
"wallet_status",
Expand Down
2 changes: 1 addition & 1 deletion crates/openhuman-app/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,12 @@ async fn cancellation_during_required_output_repair_finalizes_native_run() {
Arc::clone(&core),
async move { host.run_single_with_origin(&input, Some(origin)).await },
));
// A hang guard on the repair signal, not a speed budget: before the first
// model call the turn resolves TinyBox's local jail grants for each MCP
// sandbox seed (about 0.85 s each, three times, on an idle machine), so a
// loaded test process spent all of a 5 s bound before the model was asked.
tokio::time::timeout(
std::time::Duration::from_secs(5),
std::time::Duration::from_secs(60),
model.repair_started.notified(),
)
.await
Expand Down
30 changes: 22 additions & 8 deletions crates/openhuman-core/src/artifacts/box_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,37 @@ pub(crate) trait BoxFiles: Send + Sync {

/// The process's own boxes, for the call running under `ctx`.
pub(crate) struct SandboxBoxFiles {
ctx: DispatchCtx,
/// Weak: `PerCallTool` also builds a prototype of the tool when the belt
/// is assembled, under the building request's context, and that prototype
/// lives as long as the belt. A cached chat session keeps its belt in its
/// tenant's own state slots, so a strong context would keep the tenant in
/// use (`CoreContext::tenant_in_use`) and its profile slot never frees.
core: Option<std::sync::Weak<crate::core::runtime::CoreContext>>,
}

impl SandboxBoxFiles {
pub(crate) fn new(ctx: DispatchCtx) -> Self {
Self { ctx }
Self {
core: ctx.downgrade(),
}
}

/// The context the call runs under: the one this was built for while it
/// lives, else the calling task's own.
fn ctx(&self) -> DispatchCtx {
DispatchCtx::from_weak(self.core.as_ref())
}
}

#[async_trait]
impl BoxFiles for SandboxBoxFiles {
async fn work_folder(&self) -> Result<Option<&'static str>, BoxError> {
let config =
self.ctx.load_config().await.map_err(|error| {
BoxError::Driver(format!("cannot read the configuration: {error}"))
})?;
Ok(crate::sandbox::ops::sandbox_box_workdir(&self.ctx, &config))
let ctx = self.ctx();
let config = ctx
.load_config()
.await
.map_err(|error| BoxError::Driver(format!("cannot read the configuration: {error}")))?;
Ok(crate::sandbox::ops::sandbox_box_workdir(&ctx, &config))
}

async fn read(
Expand All @@ -78,7 +92,7 @@ impl BoxFiles for SandboxBoxFiles {
) -> Result<Vec<u8>, BoxError> {
let tenant = crate::sandbox::boxes::tenant_for_box(tenant)?;
let config =
self.ctx.load_config().await.map_err(|error| {
self.ctx().load_config().await.map_err(|error| {
BoxError::Driver(format!("cannot read the configuration: {error}"))
})?;
crate::sandbox::read_box_file(Ok(tenant), &config, path, max_bytes).await
Expand Down
29 changes: 29 additions & 0 deletions crates/openhuman-core/src/artifacts/tiny_store_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,3 +661,32 @@ fn share_artifact_is_offered_only_with_a_publisher() {
let with = names(true);
assert!(with.contains(&"share_artifact".to_string()), "{with:?}");
}

/// A cached chat session keeps its tool belt in its tenant's own state
/// slots (`web_chat::ops::thread_sessions`), so an artifact tool that held
/// the context it was built under strongly would keep that tenant in use
/// (`CoreContext::tenant_in_use`) forever, and its SaaS profile slot would
/// never free.
#[tokio::test]
async fn artifact_tools_kept_past_their_turn_do_not_keep_the_tenant_in_use() {
use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};
let root = CoreContext::for_test(DomainSet::full(), None);
let profile = root.derive_with(
ContextOverlay::new(
crate::config::Config::default(),
DomainSet::kernel(),
crate::tools::toolpacks::ToolGroups::none(),
)
.profile("p1"),
);
let (workspace, files) = temp_dirs();
let tools = CoreContext::scope_with_turn_origin(std::sync::Arc::clone(&profile), None, async {
registered_tools(&workspace, FileRoots::new(&files), &workspace, None)
})
.await;
assert!(tools.iter().any(|t| t.name() == "create_artifact"));
assert!(
!profile.tenant_in_use(),
"the kept artifact tools pin the tenant they were built under"
);
}
74 changes: 62 additions & 12 deletions crates/openhuman-core/src/core/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use super::session_expiry::{is_session_expired_error, is_unconfirmed_unauthorize
use crate::core::all;
use crate::core::runtime::{CoreContext, DispatchCtx};
use crate::core::types::AppState;
use crate::core::StructuredRpcError;

/// Invokes a JSON-RPC method by name.
///
Expand Down Expand Up @@ -171,18 +172,16 @@ fn session_failure_outcome(
current_token: Option<&str>,
) -> SessionFailureOutcome {
if api_key {
return SessionFailureOutcome::Replace {
reason: "api_key_credential",
message: "Backend request failed while using an API-key credential".to_string(),
};
return replace(
msg,
"api_key_credential",
"Backend request failed while using an API-key credential".to_string(),
);
}
if let Some(message) = translate_local_session_error(msg, local) {
// The RPC error is also observed by the renderer's auth classifier.
// Keep the background hosted probe recoverable.
return SessionFailureOutcome::Replace {
reason: "local_offline_credential",
message,
};
return replace(msg, "local_offline_credential", message);
}
if current_token.is_none() {
// Nothing was stored or sendable (no session, no API key): this is a
Expand All @@ -196,10 +195,61 @@ fn session_failure_outcome(
}
// Avoid returning an auth-expired marker that would let the renderer sign
// out a token this request may not have used.
SessionFailureOutcome::Replace {
reason: "credential_provenance_unavailable",
message: "Backend request failed; credential provenance could not be verified".to_string(),
}
replace(
msg,
"credential_provenance_unavailable",
"Backend request failed; credential provenance could not be verified".to_string(),
)
}

/// A [`SessionFailureOutcome::Replace`] whose error says `message` and keeps
/// the original [`StructuredRpcError`] `data` unless it carries a sign-out
/// marker. Codes such as memory's `UNAUTHORIZED` drive specific UI and never
/// sign out, so dropping them would only cost the renderer its branch.
fn replace(original: &str, reason: &'static str, message: String) -> SessionFailureOutcome {
let kept = StructuredRpcError::decode(original).and_then(|envelope| {
let data = envelope
.data
.filter(|data| !carries_sign_out_marker(&data.to_string()))?;
Some((data, envelope.expected_user_state))
});
log::debug!(
"[invoke][session-failure] replacing auth-expired error reason={reason} structured_data={}",
if kept.is_some() {
"kept"
} else {
"dropped_or_absent"
}
);
let message = match kept {
Some((data, expected_user_state)) => StructuredRpcError {
message,
data: Some(data),
expected_user_state,
}
.encode(),
None => message,
};
SessionFailureOutcome::Replace { reason, message }
}

/// Whether `text` holds anything that reads as "session expired, sign out":
/// [`is_session_expired_error`], or a marker the renderer's auth classifier
/// (`classifyRpcError` / `classifyAuthExpiredReason` in
/// `app/src/services/coreRpcClient.ts`) matches case-insensitively —
/// `Session expired`, `SESSION_EXPIRED`, `no backend session token`,
/// `session jwt required`.
fn carries_sign_out_marker(text: &str) -> bool {
let lower = text.to_ascii_lowercase();
is_session_expired_error(text)
|| [
"session expired",
"session_expired",
"no backend session token",
"session jwt required",
]
.iter()
.any(|marker| lower.contains(marker))
}

fn request_session_failure_is_actionable(
Expand Down
98 changes: 98 additions & 0 deletions crates/openhuman-core/src/core/invoke_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,104 @@ fn stored_credentials_keep_session_failure_rewrites() {
);
}

/// A memory engine 401 as the memory controller encodes it: a structured
/// `UNAUTHORIZED` code the UI branches on, under a message the session-expiry
/// classifier matches.
fn structured_memory_unauthorized() -> String {
crate::core::StructuredRpcError {
message: "unauthorized: [UNAUTHORIZED] memory API memory/learn on api.tinyhumans.ai: \
the session expired or the API key was rejected (HTTP 401 Unauthorized); \
re-authenticate"
.to_string(),
data: Some(json!({ "kind": "UNAUTHORIZED", "code": "UNAUTHORIZED" })),
expected_user_state: true,
}
.encode()
}

fn replaced_message(outcome: SessionFailureOutcome) -> String {
match outcome {
SessionFailureOutcome::Replace { message, .. } => message,
other => panic!("expected a replaced error, got {other:?}"),
}
}

/// The rewrite drops the auth-expired message but keeps a structured code the
/// renderer does not read as sign-out, so `memoryErrorCode` still sees
/// `UNAUTHORIZED` instead of `data: null`.
#[test]
fn replaced_session_failure_keeps_non_signout_structured_code() {
let original = structured_memory_unauthorized();
assert!(is_session_expired_error(&original));
let cases = [
(
session_failure_outcome(&original, false, false, None, Some("header.payload.sig")),
"Backend request failed; credential provenance could not be verified",
),
(
session_failure_outcome(&original, false, true, None, None),
"Backend request failed while using an API-key credential",
),
(
session_failure_outcome(&original, true, false, None, Some("header.payload.local")),
crate::core::observability::BACKEND_UNAVAILABLE_PREFIX,
),
];
for (outcome, expected_message) in cases {
let message = replaced_message(outcome);
assert!(!is_session_expired_error(&message), "{message}");
let envelope = crate::core::StructuredRpcError::decode(&message)
.unwrap_or_else(|| panic!("structured envelope dropped: {message}"));
assert!(
envelope.message.starts_with(expected_message),
"{}",
envelope.message
);
assert_eq!(
envelope.data,
Some(json!({ "kind": "UNAUTHORIZED", "code": "UNAUTHORIZED" }))
);
assert!(envelope.expected_user_state);
}
}

/// A structured error whose data itself carries a sign-out marker must not
/// reach the renderer through the rewrite, in any casing or field.
#[test]
fn replaced_session_failure_never_passes_through_a_signout_marker() {
for data in [
json!({ "kind": "SESSION_EXPIRED", "code": "SESSION_EXPIRED" }),
json!({ "code": "session_expired" }),
json!({ "code": "ENGINE", "detail": "Session expired; sign in again" }),
json!({ "code": "ENGINE", "detail": "no backend session token" }),
json!({ "code": "ENGINE", "detail": "session JWT required" }),
] {
let original = crate::core::StructuredRpcError {
message: "SESSION_EXPIRED: backend rejected session token".to_string(),
data: Some(data.clone()),
expected_user_state: false,
}
.encode();
let message = replaced_message(session_failure_outcome(
&original,
false,
false,
None,
Some("header.payload.sig"),
));
assert!(!is_session_expired_error(&message), "{message}");
let lower = message.to_ascii_lowercase();
assert!(
!lower.contains("session_expired") && !lower.contains("session expired"),
"{message}"
);
assert!(
crate::core::StructuredRpcError::decode(&message).is_none_or(|e| e.data.is_none()),
"{data} leaked: {message}"
);
}
}

/// #8081: a Memory tab on a plan without memory got `403 MEMORY_PLAN_REQUIRED`
/// from the hosted engine, whose message said "the session expired", and the
/// user was signed out. Neither that nor a plain memory 403 may publish
Expand Down
Loading
Loading