Skip to content

fix(wikipage): log wikipage fetches for jobs#107

Merged
Moskize91 merged 2 commits into
mainfrom
codex/wikipage-fetch-logs
Jul 8, 2026
Merged

fix(wikipage): log wikipage fetches for jobs#107
Moskize91 merged 2 commits into
mainfrom
codex/wikipage-fetch-logs

Conversation

@Moskize91

Copy link
Copy Markdown
Contributor

Summary

  • add compact JSONL logging for wikipage fetches under job artifacts
  • pass job log paths into knowledge-graph wikipage resolver sessions
  • rename the first LLM request log from request.log to request-1.log for consistent numbering
  • bump package version to 0.3.1

Verification

  • pnpm run format:check
  • pnpm run lint
  • pnpm run typecheck
  • pnpm test:run
  • pnpm run lint:fix
  • manually confirmed new job logs include artifacts/wikipage/wikipage-fetch.jsonl and request-1.log naming

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ac51762b-96d1-41be-94fc-19068ea310fc

📥 Commits

Reviewing files that changed from the base of the PR and between f6bd2d9 and b51d78b.

📒 Files selected for processing (2)
  • src/wikipage/wikimedia-client.ts
  • test/wikipage/resolver.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/wikipage/wikimedia-client.ts

Summary by CodeRabbit

  • New Features

    • Added detailed fetch/request logging for Wikipedia resolution and LLM requests when logging is enabled.
    • Log files are now consistently numbered, making repeated runs easier to track.
  • Bug Fixes

    • Improved handling of failed network responses, including better capture of error details and response text when available.
    • Logging failures no longer interrupt normal resolution or request processing.
  • Chores

    • Bumped the package version to 0.3.1.

Walkthrough

This PR adds request logging for Wikimedia/Wikipedia fetch operations. A new WikipageFetchLog module records JSONL entries per fetch attempt, including timing, status, errors, truncated response text, and batch summaries. WikipageResolverOptions gains logDirPath, which is threaded through the CLI, resolver, and WikimediaClient. allocateArtifactPath also gains alwaysNumbered, used for request logs. Tests are added for artifact naming and resolver fetch-log output, and package.json is bumped to 0.3.1.

Possibly related PRs

  • oomol-lab/wiki-graph#105: Both PRs touch the knowledge-graph build call site in src/cli/queue.ts, including the generateChapterKnowledgeGraphArtifactFromSnapshot path.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required format and accurately describes the main wikipage fetch logging change.
Description check ✅ Passed The description is clearly related to the changeset and covers the logging, path wiring, version bump, and verification.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/wikipage-fetch-logs

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/wikipage/wikimedia-client.ts`:
- Around line 249-289: The request logging in `#fetchJsonOnce` is masking the
actual fetch outcome because each this.#requestLog.append call can throw and
replace either a successful response or the real network/HTTP error. Update the
logging in WikimediaClient.#fetchJsonOnce so append failures are handled
separately from fetch handling, using getLogger and formatError to record the
logging error without rethrowing it, while preserving the original behavior for
the success, non-OK, and exception paths. Ensure the three branches around
this.#requestLog.append still return/throw the intended fetch result even if
logging fails.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d0bb5c2-5b02-4c58-9236-524457e06dd3

📥 Commits

Reviewing files that changed from the base of the PR and between 2f918b5 and f6bd2d9.

📒 Files selected for processing (11)
  • package.json
  • src/cli/queue.ts
  • src/common/logging.ts
  • src/llm/request-log.ts
  • src/wikipage/fetch-log.ts
  • src/wikipage/resolver.ts
  • src/wikipage/types.ts
  • src/wikipage/wikimedia-client.ts
  • test/common/logging.test.ts
  • test/llm/client.test.ts
  • test/wikipage/resolver.test.ts

Comment thread src/wikipage/wikimedia-client.ts Outdated
@Moskize91 Moskize91 changed the title fix: log wikipage fetches for jobs fix(wikipage): log wikipage fetches for jobs Jul 8, 2026
@Moskize91 Moskize91 merged commit 223050c into main Jul 8, 2026
3 checks passed
@Moskize91 Moskize91 deleted the codex/wikipage-fetch-logs branch July 8, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant