fix: use minute-level granularity for MOIM timestamps#1
Closed
fix: use minute-level granularity for MOIM timestamps#1
Conversation
5605b89 to
81116ff
Compare
Prevents agent infinite loop by using minute-level timestamps (:00) instead of second-level timestamps. This keeps conversation stable within a 1-minute window, preventing agents from repeatedly updating timestamp comments in files. Fixes the reported issue where agents would edit files every 5-7 seconds to update datetime comments like: # Datetime: 2025-12-29 09:06:51 # Datetime: 2025-12-29 09:06:58 (7s later) # Datetime: 2025-12-29 09:07:03 (5s later) ... continuing indefinitely Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
81116ff to
3620572
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes agent infinite loop caused by second-level timestamp changes in MOIM (Minus One Info Message) injection.
Problem
Agent repeatedly updates files every 5-7 seconds, only changing the datetime comment:
Root Cause
collect_moim()generates timestamp with second-level precision (%Y-%m-%d %H:%M:%S)<info-msg>is injected into conversation viainject_moim()Solution
Use minute-level granularity by fixing seconds to
:00:This keeps conversation stable within a 1-minute window, preventing infinite loop for 99% of use cases (tasks completing within 1 minute).
Impact
Type of Change
AI Assistance
Testing
Added test to verify minute-level granularity:
All existing tests continue to pass (6 existing + 1 new = 7 total).
Manual testing confirmed the infinite loop no longer occurs for tasks completing within 1 minute.
Related Issues
Builds on block#6101 which changed datetime format from "Datetime:" to "It is currently" to help LLMs recognize the current year.
While block#6101 improved LLM understanding, it didn't address the infinite loop issue caused by second-level timestamp changes. This PR completes the fix by using minute-level granularity.
Relates to block#6066
Screenshots/Demos (for UX changes)
N/A - Internal behavior change only