Skip to content

feat(hub): adopt shared agent inventory API - #10

Merged
jack-arturo merged 8 commits into
mainfrom
feat/hub-agent-inventory
Sep 22, 2026
Merged

jack-arturo merged 8 commits into
mainfrom
feat/hub-agent-inventory

Conversation

@jack-arturo

@jack-arturo jack-arturo commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

CottageCode can now use AutoHub's shared task inventory so both apps show the same canonical tasks, child relationships, current activity, and available controls. Set AUTOHUB_HUB_BASE to the Hub API server to select this adapter; plain npm start retains the existing standalone behavior when no Hub setting is present. Both npm start and npm run once optionally load the Git-ignored local .env, so a per-checkout Hub default persists without a global shell export.

The adapter honors canonical freshness and model/provider hints for active status, follows every /v1/tasks cursor page, maps list/detail/timeline/checklist data into the existing town presentation, and replaces local SQLite inventory and Claude discovery in Hub mode. A failed refresh preserves the last complete snapshot with an explicit stale state. Activity detail reads leave the enriched inventory snapshot intact, and transient detail failures retain cached journal events with a stale indicator. Older journal reads keep bounded historical windows separate from forward polling. The browser retains independent 1,500-entry historical and recent windows, with a Latest entries action that restores live updates without gaps. Optional AUTOHUB_HUB_TOKEN credentials stay in the Node server. Result links pass the existing credential-rejecting URL normalizer before populating artifact shelves, and original requests retain the public length limit. User-submitted messages refresh canonical identity, freshness, and capabilities before delivery, with attention-version checks for replies and existing receipt deduplication preserved.

Validation:

  • npm test: 300 passing tests, including pagination, canonical identities, stale snapshot recovery, credential handling, controls, and standalone behavior.
  • Real loopback CottageCode → AutoHub Express → isolated Prisma/SQLite smoke: all 61 canonical records were mapped and task activity was readable.
  • Actual CLI smoke in an isolated checkout verified .env loading, shell-variable precedence, and standalone behavior without the file.
  • git diff --check passed; branch is based on current origin/main.

No breaking changes to the feed contract or standalone defaults. Activation requires an AutoHub server containing the shared /v1/tasks inventory additions; configuring this user's local launcher is a separate rollout step.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T17:34:57.190013Z 1116d39 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8acc98e40a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/messages.mjs Outdated
Comment thread src/hub-inventory.mjs Outdated
@jack-arturo jack-arturo added the babysit:active Babysit agent is actively working this PR label Sep 22, 2026
@jack-arturo jack-arturo added babysit:waiting-ci Babysit waiting for CI checks on current head babysit:waiting-codex 👀 Codex reviewing current head and removed babysit:active Babysit agent is actively working this PR babysit:waiting-ci Babysit waiting for CI checks on current head labels Sep 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df330c601b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/feed.mjs Outdated
@jack-arturo jack-arturo added babysit:active Babysit agent is actively working this PR and removed babysit:waiting-codex 👀 Codex reviewing current head labels Sep 22, 2026
@jack-arturo jack-arturo added babysit:waiting-codex 👀 Codex reviewing current head and removed babysit:active Babysit agent is actively working this PR labels Sep 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0cce42daf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/messages.mjs Outdated
Comment thread src/feed.mjs Outdated
@jack-arturo jack-arturo added babysit:active Babysit agent is actively working this PR and removed babysit:waiting-codex 👀 Codex reviewing current head labels Sep 22, 2026
@jack-arturo jack-arturo added babysit:waiting-codex 👀 Codex reviewing current head and removed babysit:active Babysit agent is actively working this PR labels Sep 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b52bbcc25d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/hub-inventory.mjs
@jack-arturo jack-arturo added babysit:active Babysit agent is actively working this PR and removed babysit:waiting-codex 👀 Codex reviewing current head labels Sep 22, 2026
@jack-arturo jack-arturo added babysit:waiting-codex 👀 Codex reviewing current head and removed babysit:active Babysit agent is actively working this PR labels Sep 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa3de05a36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/hub-inventory.mjs
@jack-arturo jack-arturo added babysit:active Babysit agent is actively working this PR and removed babysit:waiting-codex 👀 Codex reviewing current head labels Sep 22, 2026
@jack-arturo jack-arturo added babysit:waiting-codex 👀 Codex reviewing current head and removed babysit:active Babysit agent is actively working this PR labels Sep 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85b98d294d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/observatory.mjs
@jack-arturo

Copy link
Copy Markdown
Member Author

Review budget gate: the sixth review window identified a browser history regression in the previous retention fix. A bounded correction is prepared locally: retain separate 1,500-entry recent and historical windows, offer Latest entries, and ignore late historical responses after returning to live activity. All 298 local tests pass. Publication and further automated review are paused pending an explicit babysit budget reset; the PR has not been merged and the primary checkout remains unchanged.

@jack-arturo jack-arturo added babysit:blocked Babysit stopped; unresolved blocker needs human and removed babysit:waiting-codex 👀 Codex reviewing current head labels Sep 22, 2026
@jack-arturo

Copy link
Copy Markdown
Member Author

Human approved a fresh remediation budget of at most TWO additional review windows for PR #10: “You can do a couple more babysit rounds on each of those and merge once they’re green. (aka approved)”. Previous six windows remain recorded; this reset starts the explicitly bounded continuation. The prepared journal correction has 298 passing tests and a 309-test combined-checkout rehearsal.

@jack-arturo jack-arturo added babysit:active Babysit agent is actively working this PR and removed babysit:blocked Babysit stopped; unresolved blocker needs human labels Sep 22, 2026
@jack-arturo jack-arturo added babysit:waiting-codex 👀 Codex reviewing current head and removed babysit:active Babysit agent is actively working this PR labels Sep 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90f166a193

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/hub-inventory.mjs Outdated
Comment thread src/hub-inventory.mjs Outdated
@jack-arturo jack-arturo added babysit:active Babysit agent is actively working this PR and removed babysit:waiting-codex 👀 Codex reviewing current head labels Sep 22, 2026
@jack-arturo jack-arturo added babysit:waiting-codex 👀 Codex reviewing current head and removed babysit:active Babysit agent is actively working this PR labels Sep 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1116d39591

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/hub-inventory.mjs
Comment on lines +48 to +49
const canonicalFresh = task.freshness?.isStale===false || task.isStale===false;
if((task.normalizedStatus || task.status)==='running' && canonicalFresh && !cottage.inputRequest) cottage.status='working';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep archived tasks offline despite fresh heartbeat data

When the history inventory includes an archived task whose last raw status is still running and whose canonical freshness is false, toCottage() first marks it offline because it is archived, but this override revives it as working and classifyOccupancy() then treats it as live. Such historical tasks consequently render smoke and warm working windows even though cottage.terminal is true; require !task.archived before applying the fresh-running override.

AGENTS.md reference: AGENTS.md:L79-L80

Useful? React with 👍 / 👎.

Comment thread src/feed.mjs
Comment on lines +431 to +432
...page, stale: true, error: "Hub task detail temporarily unavailable",
inputRequest: page.inputRequest ? {...page.inputRequest,stale:true} : null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply stale input evidence before enabling Send

When task detail fails but the inventory list remains healthy, this response correctly marks the cached input request stale, yet the browser's ensureActivity() consumes only the page and todos and never applies data.inputRequest to the agent used by capabilityFor(). Fresh evidence after the earlier fix is that the newly returned stale marker is therefore ignored: the conversation form remains enabled and every attempted Send is rejected only after the server repeats the failing detail check. Propagate this input state or include the activity cache's stale state when computing the browser capability.

Useful? React with 👍 / 👎.

@jack-arturo

Copy link
Copy Markdown
Member Author

Review budget gate: both explicitly approved additional windows are complete. The final window identified two new edge cases: archived tasks revived by the canonical-freshness override, and stale activity evidence not disabling browser Send while inventory remains healthy. Both bounded corrections are prepared locally with failing-first regressions; all 302 feature tests and 313 combined-checkout tests pass. The server continues to reject sends when fresh detail cannot be verified. Further publication/review and merge remain paused pending direction; primary files and the running service are unchanged.

@jack-arturo jack-arturo added babysit:blocked Babysit stopped; unresolved blocker needs human and removed babysit:waiting-codex 👀 Codex reviewing current head labels Sep 22, 2026
@jack-arturo
jack-arturo merged commit acc3250 into main Sep 22, 2026
1 check passed
@jack-arturo jack-arturo removed the babysit:blocked Babysit stopped; unresolved blocker needs human label Sep 22, 2026
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