-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix: use minute-level granularity for MOIM timestamps #6294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use minute-level granularity for MOIM timestamps #6294
Conversation
81116ff to
3620572
Compare
|
thanks @sihyeonn do you mind updating this to main and resolving conflicts? |
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 <[email protected]>
3620572 to
59a0ab5
Compare
|
@michaelneale thanks, I handled |
michaelneale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @sihyeonn I think it makes sense. Nice to have a simple test and worth having. I'll tag @tlongwell-block who has spent time on MOIM just in case we need to walk this back if there is some unexpected side effect but I think worth it.
|
can you explain this more, @michaelneale @sihyeonn ? how does this happen? the MOIM message is only supposed to added on a user message, how does the agent reactivate based on this? and it does, how does changing this to minutes from seconds help? from the logs it looks more to me that this is adding the MOIM in the wrong place |
|
This makes sense to me @DOsinga Weaker models will see that we're providing the current time, then notice that the file they wrote last turn (that includes a timestamp for some reason) is not matching what is provided and think its an error. Then it updates the file on the next turn... at which point the timestamp we provide it has already updated again... |
|
Look at the screenshot, the replacement string it is trying to insert contains the moim. not the timestamp, the entire MOIM. that suggests to me that something is going rather wrong here. I'd love to see the exported converstation here to see what actually happened (or better the diagnostics) Even if your theory is correct than this is not the solution. The solution would be to insert a stable timestamp based on when the interaction with the agent for this cycle begins, not rounding it up to a minute. longer interactions can easily take a minute so this is just not going to solve this. |
|
@tlongwell-block That's exactly what I experienced.
Agreed. Minute-level granularity is only a partial fix. I’m planning a follow-up PR so that collect_moim() returns None when there’s no platform content. That way, the block won’t be injected at all unless there’s actual content to include. This should also help with another related issue I noticed: the model seems to interpret
Just in case, I’m adding the Korean message from the screenshot verbatim (translation aid):
|
|
Having the current time/date is probably a good thing since sessions can be resumed hours/days/weeks apart The minute granularity is not a complete fix, but it will probably provide enough buffer for goose to get through a few more messages/actions and stop futzing with that particular file edit The MOIM is a user message, implementation-wise |
that's not what I am saying; I'm saying we shouldn't change the timestamp during the interaction with the agent. if you remember when we were implementing this I was reluctant to have the MOIM update at all during the agent tool calling loop; this report including the fact that models might have trouble make me think that we should think about that again. MOIM always being part of the last user message that is actually from the user side steps these issues |

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 #6101 which changed datetime format from "Datetime:" to "It is currently" to help LLMs recognize the current year.
While #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 #6066
Screenshots/Demos (for UX changes)