agent-orchestrator/packages/plugins
Adil Shaikh cf5a418a48
fix(scm-github): silence HTTP 304 warnings in ETag guards (#1581)
* fix(scm-github): silence HTTP 304 warnings in ETag guards and use observer logging

ETag guard functions and the GraphQL batch handler used raw console.warn()/
console.error() that fired on every poll cycle, including expected HTTP 304
(Not Modified) responses. This flooded the orchestrator terminal with noise.

- Add 304 fallback check in error message for cases where gh CLI doesn't
  populate stdout/stderr on non-zero exit
- Migrate all 4 raw console.warn()/console.error() calls to observer?.log()
  for consistency with the rest of the file
- Thread observer parameter through shouldRefreshPREnrichment and the three
  ETag guard functions (checkPRListETag, checkCommitStatusETag,
  checkReviewCommentsETag)
- Update test to verify observer-based logging instead of console spy

Closes #1580

* fix(scm-github): use word boundary in 304 regex to prevent false positives

Use \b304\b instead of /304/ to avoid matching substrings like "3040"
or "30400" in error messages.

Closes #1580

* fix(scm-github): use is304() for error message fallback and thread observer into getReviewThreads

1. Replace \b304\b regex with is304() (anchored to HTTP status line) in all
   three ETag guard fallback paths. Prevents false positives from URL paths
   like "pulls/304/comments" appearing in Node's execFile error messages.

2. Capture instance-level observer in createGitHubSCM() and pass it to
   checkReviewCommentsETag and getReviewThreads error logging. Non-304
   errors on the review polling path are now visible via observer instead
   of being silently swallowed by lifecycle's catch.

3. Restore "error" severity for partial batch failures in
   enrichSessionsPRBatchImpl (was incorrectly downgraded to "warn").

4. Add tests for Guard 1 URL false-positive, Guard 2 error logging,
   and Guard 2 HTTP 304 fallback paths.

Closes #1580

* test(scm-github): add Guard 3 (checkReviewCommentsETag) tests

Add 5 tests for the review comments ETag guard covering:
- 200 response (changed) and 304 response (unchanged)
- Error with observer logging
- HTTP 304 in error message treated as cache hit
- URL containing "304" NOT treated as cache hit (false-positive prevention)

This completes the test coverage for all three ETag guard functions'
error and 304-fallback paths, as requested in review.

Closes #1580
2026-05-03 18:30:27 +05:30
..
agent-aider chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
agent-claude-code Fix native restore fallback for Claude and Codex sessions (#1602) 2026-05-01 21:27:17 +05:30
agent-codex Fix native restore fallback for Claude and Codex sessions (#1602) 2026-05-01 21:27:17 +05:30
agent-cursor chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
agent-kimicode feat(plugin): implement kimicode agent plugin (#1390) 2026-05-01 14:11:30 +05:30
agent-opencode chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
notifier-composio chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
notifier-desktop chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
notifier-discord chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
notifier-openclaw chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
notifier-slack chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
notifier-webhook chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
runtime-process chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
runtime-tmux chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
scm-github fix(scm-github): silence HTTP 304 warnings in ETag guards (#1581) 2026-05-03 18:30:27 +05:30
scm-gitlab chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
terminal-iterm2 chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
terminal-web chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
tracker-github chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
tracker-gitlab chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
tracker-linear chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
workspace-clone chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30
workspace-worktree chore: align workspace package.json versions with npm registry (#1587) 2026-05-01 15:31:04 +05:30