Skip to content
TheChatArchiveThe Chat Archive
x-ai/grok-4.5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Isolated cron runs leak context when they reuse a stable session key…

  1. User

    ISSUE DESCRIPTION

    Isolated cron runs leak context when they reuse a stable session key

    Different isolated cron runtime sessions that reuse a stable session key must not share active LCM context. Prior runs remain archived, compaction within the current run still works, and ordinary non-cron session continuity is unchanged.

    Interface

    No new public interfaces are introduced.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /lossless-claw, current file: none) bash-$

  2. Assistant

    I'll start by exploring the repository structure and searching for code related to isolated cron runs and session keys.

  3. Assistant

    Let me search for cron-related code and LCM context / session key handling.

  4. Assistant

    Let me use grep instead of rg.

  5. Assistant

    Let me look at session-patterns and engine related to cron, and CHANGELOG for related context.

  6. Assistant

    Let me search for more specific terms related to isolated cron runs and session keys in the changelog and relevant source files.

  7. Assistant

    Let me look for how session creation identity works with cron, and specifically anything about isolated crons.

  8. Assistant

    Let me look at more of the engine around isolated sessions, and look for "isStatelessSession" which seemed interesting.

  9. Assistant

    Let me search for related tests or changelog entries that might hint at expected behavior.

  10. Assistant

    Let me look at git history or any recent related fixes, and also look for "isolated cron" more carefully. Also check AGENTS.md and architecture docs.

  11. Assistant

    Let me look at the skill about session lifecycle and any related tests about rotation when sessionId changes but sessionKey stays the same.

  12. Assistant

    Let me dig into bootstrap and conversation creation for session ID/key mismatches.

  13. Assistant

    There's already handling for when session files go missing. But the issue is specifically about isolated cron runs that reuse a stable session key - perhaps the session files don't get deleted between...

  14. Assistant

    Let me look at git log for recent related commits and also look at conversation-scope which might have session family logic. Also look at openclaw-bridge for hooks related to cron.

  15. Assistant

    Let me look at openclaw.plugin.json and the plugin hooks, and also search for any incomplete work or TODOs related to this issue. Also check if there's a failing te...

  16. Assistant

    Looking at getOrCreateConversation where sessionId gets updated on the existing row — that may be the leak.

  17. Assistant

    Let me look at how OpenClaw presents isolated cron sessions - maybe there's something in node_modules/openclaw.

  18. Assistant

    No openclaw package. Let me look at CHANGELOG more carefully and any incomplete mentions. Also check git stash and branches.

  19. Assistant

    There's a relevantchangeset; let me read the assemble path and the stale session key rollover related code more carefully.

  20. Assistant

    Looking atenterprise the ambiguous rollover case: when old transcript still exists and sessionId changes under same sessionKey, it fails closed. For isolated cron that reuses a stable session key, eac...

  21. Assistant

    Let me check how afterTurn and ingest handle the conversation lookup path more carefully.

  22. Assistant

    Looking at the afterTurn flow around line 6696 - when there's ambiguous rollover...

  23. Assistant

    Let me check default ignore patterns and any existing helpers that identify cron session keys.

  24. Assistant

    Let me look at doctor cleaners for cron and also search for any relevant unfinished code or TODO about isolated sessions. Also look at openclaw bridge.

  25. Assistant

    Let me look at git show of recent related PR and README for more about cron. Also check if there's something in the AGENTS.md about this task.

  26. Assistant

    Let me also look at session patterns and engine for any comment about isolated runs. Maybe search git history more carefully for stuff that was attempted.

  27. Assistant

    Let me try searching GitHub issues via git notes or any patch files. Or maybe look at test file names more carefully for something about cron isolation. I need to understand the current codebase structure to implement this fix properly. Let me explore the repository to find relevant files. I'll start by listing the directory contents to see what's available.

    Let me check what files are in the root directory: bash-$ ls -la

    I should look for files related to sessions, LCM (Long Context Memory), cron handling, and conversation management. Let me search for session-related code.

    Let me try to find files containing "session" or "cron": bash-$ find . -name ".ts" -o -name ".js" | head -20

    Let me check the package.

  28. Assistant

    Let me check getOrCreateConversation call sites and the beginning of engine.ts for helpers.

  29. Assistant

    I'll implement rotation for isolated cron session keys when the runtime sessionId changes, so prior runs are archived and don't share active LCM context.

  30. Assistant

    I'll add the isCronSessionKey helper to session-patterns.ts

  31. Assistant

    Now I'm updating engine.ts to import isCronSessionKey and add rotation logic.

  32. Assistant

    Next I'll add the rotate method next to the existing stale session-key handler.

  33. Assistant

    I'll insert the new method after rotateStaleSessionKeyConversationIfTrackedTranscriptMissing and before findAmbiguousSessionKeyRuntimeRollover.

  34. Assistant

    The edit introduced duplicates — I'll clean those up.

  35. Assistant

    I'll restore the phase parameter on findAmbiguousSessionKeyRuntimeRollover that was dropped.

  36. Assistant

    Wiring the new rotator into bootstrap, assemble, afterTurn, and ingest next.

  37. Assistant

    Let me look at each call site and add the cron rotation right after.

  38. Assistant

    Oops, I used the wrong syntax for sed - need commas not colons.

  39. Assistant

    I'll add the rotation call after each rotateStale call and before getOrCreate in ingest.

  40. Assistant

    I need to goto the location first.

  41. Assistant

    Now I'll do the replace.

  42. Assistant

    Good. Now bootstrap.

  43. Assistant

    I'll add the cron rotate after stale rotate in bootstrap.

  44. Assistant

    Now assemble path.

  45. Assistant

    Add cron rotation to assemble.

  46. Assistant

    Now ingestSingle - before getOrCreateConversation.

  47. Assistant

    I'll add rotate before getOrCreate in ingestSingle.

  48. Assistant

    Fixing ingest: keep getOrCreate after rotation so ordinary session continuity still updates sessionId.

  49. Assistant

    Checking whether compact needs the same guard when called before bootstrap.

  50. Assistant

    Guarding compact so isolated cron can't compact a prior run's conversation.

  51. Assistant

    I'll update compact to rotate first.

  52. Assistant

    Reverting the sessionId match check in compact — it would break ordinary session continuity.

  53. Assistant

    I'll extend the phase type to include "compact" for the compact path.

  54. Assistant

    Need to goto first.

  55. Assistant

    Update phase type and compact call.

  56. Assistant

    Update compact to use phase: "compact"

  57. Assistant

    update phase to compact

  58. Assistant

    Next I'll write a temporary verification script based on the engine test helpers, and add a changeset.

  59. Assistant

    I'll create a temporary script that verifies the behavior.

  60. Assistant

    The create command seems to have created an empty file outside the repo. Let me put the script inside the repo temp folder or write it correctly.

  61. Assistant

    Verification passed. Running related existing tests next.

  62. Assistant

    The filtered tests passed. Let me run a broader set of engine tests related to bootstrap/rotation more carefully too. And session-patterns test - one was s...

  63. Assistant

    All related tests pass. I'll add a changeset and clean up the temp script.

  64. Assistant

    Checking typecheck exit code and running more of the engine test suite.

  65. Assistant

    All 317 engine tests pass. Reviewing the final diff for quality.

  66. Assistant

    Moving isCronSessionKey to a non-exported helper so we don't introduce a new public interface.

  67. Assistant

    Now I'll add a module-level private function in engine.ts and remove the import.

  68. Assistant

    Need to open engine.ts first.

  69. Assistant

    Restore import and add local helper.

  70. Assistant

    Add isCronSessionKey as a module-private function near the constants.

  71. Assistant

    session-patterns.ts should be back to original. Let me verify and re-run the verification script quickly plus key engine tests.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.