Skip to content

okf: dedupe default model, emit okf_version in root index#161

Open
MuhammadHasbiAshshiddieqy wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
MuhammadHasbiAshshiddieqy:fix/okf-model-dedup-and-okf-version
Open

okf: dedupe default model, emit okf_version in root index#161
MuhammadHasbiAshshiddieqy wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
MuhammadHasbiAshshiddieqy:fix/okf-model-dedup-and-okf-version

Conversation

@MuhammadHasbiAshshiddieqy

Copy link
Copy Markdown

Summary

Three small correctness/consistency fixes in the reference_agent package, plus a stale-URL fix.

  • Single-source the default model. bundle/index.py redefined "gemini-flash-latest" as its own _FALLBACK_MODEL, independent of agent.DEFAULT_MODEL. They were identical but could silently drift if one was changed. DEFAULT_MODEL now lives in the dependency-free package __init__, which both agent.py and bundle/index.py import. (Importing it from agent.py would introduce a circular import: bundle/__init__ → index → agent → tools.bundle_tools → bundle; the leaf-module placement avoids that.)
  • Emit okf_version (SPEC §11). The bundle-root index.md now declares okf_version: "0.1" in frontmatter — the one index file the spec permits to carry frontmatter. Subdirectory indexes stay frontmatter-free. Adds a regression test.
  • Clarify the frontmatter contract. REQUIRED_FRONTMATTER_KEYS enforces four keys, but the OKF spec requires only type (title/description/timestamp are recommended). Added a comment documenting that this is the agent's quality bar for generated docs — not a spec-conformance claim — and reworded the prompt heading so the stricter check isn't mistaken for the spec. No behavior change.
  • Fix stale User-Agent URL in the web fetcher (pointed at a personal repo; now points at this repo).

Testing

pytest — 34 passed (was 33; +1 new test for the okf_version behavior).

Notes

A separate, related consistency question — the SPEC §5.1 "recommended" absolute links vs. the agent prompt's "never start a link with /" — is intentionally not addressed here, since it's a design tradeoff that warrants maintainer input. Happy to file an issue.

🤖 Generated with Claude Code

Three small correctness/consistency fixes in the reference_agent package:

- Single-source the default Gemini model. bundle/index.py redefined
  "gemini-flash-latest" as its own _FALLBACK_MODEL, independent of
  agent.DEFAULT_MODEL. They were identical but could silently drift.
  DEFAULT_MODEL now lives in the dependency-free package __init__, which
  both agent.py and bundle/index.py import — avoiding the import cycle
  that arises if index.py imports it from agent.py.

- Emit okf_version in the bundle-root index.md frontmatter (SPEC §11),
  the one index file permitted to carry frontmatter. Subdirectory
  indexes remain frontmatter-free. Adds a regression test.

- Clarify that REQUIRED_FRONTMATTER_KEYS is the agent's quality bar, not
  OKF conformance (the SPEC requires only `type`); reword the prompt
  heading accordingly so the stricter check isn't mistaken for the spec.

- Point the web fetcher User-Agent at the canonical repo URL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@google-cla

google-cla Bot commented Jun 30, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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