Skip to content

Commit e142e8d

Browse files
Trinity Agentclaude
andcommitted
fix(loop): replace catch unreachable with try in self_hosting_loop.zig init (#159)
Replace unsafe `catch unreachable` with `try` for ArrayList initialization in SelfHostingSession.init(). Allocation can fail, so error propagation is required instead of asserting impossibility. Closes #159 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c16ed8f commit e142e8d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/tri/self_hosting_loop.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ pub const SelfHostingSession = struct {
196196
.safeguards = safeguards,
197197
.session_id = session_id,
198198
.start_time = start_time,
199-
.target_files = std.ArrayList([]const u8).initCapacity(allocator, 0) catch unreachable,
200-
.patch_history = std.ArrayList(SelfPatch).initCapacity(allocator, 0) catch unreachable,
199+
.target_files = try std.ArrayList([]const u8).initCapacity(allocator, 0),
200+
.patch_history = try std.ArrayList(SelfPatch).initCapacity(allocator, 0),
201201
.metrics = ImprovementMetrics{},
202202
.current_branch = current_branch,
203203
.backup_dir = backup_dir,

0 commit comments

Comments
 (0)