Skip to content

Comments

Use chibi native autodestruct TTL instead of explicit destroy_context#44

Merged
terraboops merged 1 commit intomainfrom
chibi-autodestruct
Feb 21, 2026
Merged

Use chibi native autodestruct TTL instead of explicit destroy_context#44
terraboops merged 1 commit intomainfrom
chibi-autodestruct

Conversation

@emesal
Copy link
Owner

@emesal emesal commented Feb 21, 2026

Summary

  • Replaces the explicit destroy_context call in ChibiSession.close() with destroy_after_seconds_inactive=43200 (12h) set via flags on the set_system_prompt invocation
  • Chibi's built-in GC handles context cleanup automatically, which is more robust — sessions are cleaned up even if close() never runs (e.g. crashes)
  • Uses the newly promoted destroy_after_seconds_inactive field in ExecutionFlags (chibi 0.8.8+), no longer a debug flag

Test plan

  • chibi-harness.test.ts (new): TTL present on set_system_prompt, absent on send_prompt, no destroy_context on close(), unique context names per session
  • Run npm test in packages/autonav — 4 new tests pass, no regressions

Replace the explicit destroy_context call in ChibiSession.close() with
destroy_after_seconds_inactive=43200 (12h) set at session start via the
set_system_prompt invocation flags. Chibi's GC then handles cleanup
automatically, which is more robust as it survives crashes where close()
never runs.

Adds chibi-harness.test.ts covering TTL presence on set_system_prompt,
absence on send_prompt, no destroy_context on close, and unique context
names per session.
@terraboops terraboops merged commit 3772c0e into main Feb 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants