opencode-pilot 0.25.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/service/poller.js +13 -0
- package/test/unit/poller.test.js +19 -0
package/package.json
CHANGED
package/service/poller.js
CHANGED
|
@@ -1215,7 +1215,20 @@ export function createPoller(options = {}) {
|
|
|
1215
1215
|
if (!meta) return false; // Not processed before
|
|
1216
1216
|
|
|
1217
1217
|
// Check if item reappeared after being missing (e.g., uncompleted reminder)
|
|
1218
|
+
// Exception: suppress reprocessing when the item cycled through an intermediate
|
|
1219
|
+
// state (e.g., Linear: In Progress -> In Review -> In Progress). If the stored
|
|
1220
|
+
// state and the current state are both "in progress", the issue just passed
|
|
1221
|
+
// through code review and back — no new work is needed.
|
|
1218
1222
|
if (meta.wasUnseen) {
|
|
1223
|
+
const storedState = meta.itemState;
|
|
1224
|
+
const currentState = item.state || item.status;
|
|
1225
|
+
if (storedState && currentState) {
|
|
1226
|
+
const stored = storedState.toLowerCase();
|
|
1227
|
+
const current = currentState.toLowerCase();
|
|
1228
|
+
if (stored === 'in progress' && current === 'in progress') {
|
|
1229
|
+
return false;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1219
1232
|
return true;
|
|
1220
1233
|
}
|
|
1221
1234
|
|
package/test/unit/poller.test.js
CHANGED
|
@@ -746,6 +746,25 @@ describe('poller.js', () => {
|
|
|
746
746
|
);
|
|
747
747
|
});
|
|
748
748
|
|
|
749
|
+
test('shouldReprocess returns false when Linear issue cycles in_progress -> code_review -> in_progress', async () => {
|
|
750
|
+
const { createPoller } = await import('../../service/poller.js');
|
|
751
|
+
|
|
752
|
+
const poller = createPoller({ stateFile });
|
|
753
|
+
// Issue was processed while in_progress
|
|
754
|
+
poller.markProcessed('linear:ENG-1', { source: 'linear', itemState: 'In Progress' });
|
|
755
|
+
|
|
756
|
+
// Issue moved to In Review - disappears from the "my ready issues" poll
|
|
757
|
+
poller.markUnseen('linear', []);
|
|
758
|
+
|
|
759
|
+
// Issue moved back to In Progress - reappears
|
|
760
|
+
const item = { id: 'linear:ENG-1', status: 'In Progress' };
|
|
761
|
+
assert.strictEqual(
|
|
762
|
+
poller.shouldReprocess(item, { reprocessOn: ['status'] }),
|
|
763
|
+
false,
|
|
764
|
+
'should NOT reprocess: issue cycled through code review and returned to same in_progress state'
|
|
765
|
+
);
|
|
766
|
+
});
|
|
767
|
+
|
|
749
768
|
test('shouldReprocess returns true for reappeared item (e.g., uncompleted reminder)', async () => {
|
|
750
769
|
const { createPoller } = await import('../../service/poller.js');
|
|
751
770
|
|