Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5b31445
feat(managed-agent): add reliable ACTIVE Workspace deletion
doudouOUC Oct 4, 2026
61978cb
fix(managed-agent): align lifecycle CI fixtures
doudouOUC Oct 4, 2026
7f3e9df
fix(hosted): authorize detach after durable lifecycle recovery (#13354)
doudouOUC Oct 4, 2026
1edeff3
fix(hosted): scope lifecycle fence locks and authorization errors
doudouOUC Oct 4, 2026
7462de8
fix(managed-agent): resolve L3 migration version collision (#13354)
doudouOUC Oct 4, 2026
63e5dbc
fix(managed-agent): address PR review feedback (#13354)
doudouOUC Oct 4, 2026
841b501
fix(managed-agent): address PR CI fixture failures (#13354)
doudouOUC Oct 4, 2026
8356fb7
codex: address PR review feedback (#13354)
doudouOUC Oct 4, 2026
3cabc9f
codex: address PR review feedback (#13354)
doudouOUC Oct 5, 2026
facc4ab
fix(managed-agent): preserve main credential and migration contracts …
doudouOUC Oct 5, 2026
c65e46d
codex: address PR review feedback (#13354)
doudouOUC Oct 5, 2026
de70a07
Merge branch 'main' into codex/workspace-session-l3
wenshao Oct 5, 2026
0ddcd11
fix(managed): preserve L3 lifecycle across CSI integration
doudouOUC Oct 5, 2026
a85d082
fix(managed): restore original lifecycle Hook owner before dispatch
doudouOUC Oct 5, 2026
3649f88
codex: address PR review feedback (#13354)
doudouOUC Oct 6, 2026
1d16b9c
codex: integrate main H3 contracts for PR #13354
doudouOUC Oct 6, 2026
2d5a13a
fix(managed-agent): preserve retained owners during W2 integration
doudouOUC Oct 6, 2026
4270eb5
fix: preserve L3 contracts across H5 integration
doudouOUC Oct 6, 2026
323390f
fix: preserve L3 deletion witnesses across H0c integration
doudouOUC Oct 6, 2026
ba79b85
fix: integrate main restore authority witness
doudouOUC Oct 7, 2026
e792060
test(managed-agent): repair lifecycle receipt journal fixture
doudouOUC Oct 7, 2026
805c030
fix(managed-agent): preserve L3 delivery across Harness generation ch…
doudouOUC Oct 7, 2026
2c4036c
fix(managed-agent): register L3 internal authorization surfaces
doudouOUC Oct 7, 2026
732c1ac
fix(managed-runtime): preserve L3 authority during H4a integration
doudouOUC Oct 7, 2026
4f94b0c
fix(cli): integrate hosted Workspace context with L3 lifecycle
doudouOUC Oct 7, 2026
d0aa0d9
fix(managed-agent): integrate L3 with storage migration
doudouOUC Oct 7, 2026
a98d534
fix(managed-agent): fail closed on stale lifecycle capability client
doudouOUC Oct 7, 2026
df1ecdc
fix(managed-agent): align native lifecycle test contracts
doudouOUC Oct 7, 2026
e01b283
codex: address PR review feedback (#13354)
doudouOUC Oct 8, 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
Prev Previous commit
Next Next commit
fix(managed-agent): align native lifecycle test contracts
  • Loading branch information
doudouOUC committed Oct 7, 2026
commit df1ecdc95f9ceb2f8c19dff0404ed894b1d68542
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ void journalsNothingAfterTheSessionIsDeleted()

@Test
@Order(9)
void journalsNothingWhenTheDeletionCommitsMidCommit() throws Exception {
void serializesDeletionBehindTheRecordCommit() throws Exception {
DriverManagerDataSource dataSource = dataSource();
Flyway.configure().dataSource(dataSource)
.locations("classpath:db/migration").load().migrate();
Expand Down Expand Up @@ -886,8 +886,8 @@ void journalsNothingWhenTheDeletionCommitsMidCommit() throws Exception {
assertThat(count(jdbc, "qwen_managed_session_task_journal", tenant,
session)).isEqualTo(1);
// A second connection holds the record row, so the next commit
// blocks at its UPDATE: after its first consistent read took the
// snapshot, and before the deletion guard runs.
// blocks at its UPDATE while retaining the placement guard that
// deletion admission also needs.
try (java.sql.Connection holder = dataSource.getConnection()) {
holder.setAutoCommit(false);
try (var lock = holder.prepareStatement("SELECT record_key FROM"
Expand Down Expand Up @@ -921,19 +921,36 @@ void journalsNothingWhenTheDeletionCommitsMidCommit() throws Exception {
assertThat(System.nanoTime()).isLessThan(deadline);
Thread.sleep(50);
}
// The deletion begins and commits while the record commit waits
// behind its snapshot.
agents.beginOperation(tenant, session, OperationKind.DELETE,
"sha256:" + "e".repeat(64), "delete-mid", "digest-mid");
CompletableFuture<Object> deletion = CompletableFuture.supplyAsync(
() -> inTransaction(transactions,
() -> agents.beginOperation(tenant, session,
OperationKind.DELETE,
"sha256:" + "e".repeat(64), "delete-mid",
"digest-mid")));
String admissionBlocked = "SELECT COUNT(*) FROM"
+ " information_schema.PROCESSLIST WHERE DB = DATABASE()"
+ " AND COMMAND = 'Query' AND TIME >= 1 AND INFO LIKE"
+ " 'INSERT INTO qwen_runtime_placement_guard%'";
while (jdbc.queryForObject(admissionBlocked, Integer.class) == 0) {
assertThat(deletion).as("deletion admission must wait for"
+ " the record commit's placement guard").isNotDone();
assertThat(commit).isNotDone();
assertThat(System.nanoTime()).isLessThan(deadline);
Thread.sleep(50);
}
assertThat(deletion).isNotDone();
holder.commit();
commit.get(30, TimeUnit.SECONDS);
deletion.get(30, TimeUnit.SECONDS);
}
assertThat(jdbc.queryForObject("SELECT revision FROM"
+ " qwen_managed_session_extension_record WHERE"
+ " tenant_id = ? AND session_id = ?", Long.class,
tenant, session)).isEqualTo(2L);
assertThat(count(jdbc, "qwen_managed_session_task_journal", tenant,
session)).isEqualTo(1);
session)).isEqualTo(2);
assertThat(agents.requireSession(tenant, session).status())
.isEqualTo("DELETING");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,12 @@ void prerequisiteMigrationsPreserveExistingCloseEvidenceAndAllowRetirement() {
assertThat(jdbc.queryForMap("SELECT * FROM managed_agent_session")).containsAllEntriesOf(originalSession);
assertThat(jdbc.queryForMap("SELECT * FROM managed_agent_operation"))
.containsAllEntriesOf(originalClose)
.hasSize(originalClose.size() + 3)
.hasSize(originalClose.size() + 5)
.containsEntry("target_cwd_relative", null)
.containsEntry("expected_context_revision", null)
.containsEntry("result_context_revision", null);
.containsEntry("result_context_revision", null)
.containsEntry("lifecycle_protocol_version", 0)
.containsEntry("lifecycle_effects_receipt_json", null);
var properties = new ManagedAgentProperties();
properties.getHarness().setWorkspaceFilesEnabled(true);
var store = new ManagedAgentStore(jdbc, mapper, Clock.systemUTC(), ignored -> {}, new ManagedWorkspaceRegistry(jdbc), properties);
Expand Down
Loading