Skip to content

revert(cron): remove per-job profile support (#28124)#43956

Merged
teknium1 merged 1 commit into
mainfrom
revert/cron-profile-28124
Jun 11, 2026
Merged

revert(cron): remove per-job profile support (#28124)#43956
teknium1 merged 1 commit into
mainfrom
revert/cron-profile-28124

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Fully reverts PR #28124 — removes the per-job profile arg from cron entirely (tool schema, CLI flags, job storage, scheduler runtime override).

Changes

  • tools/cronjob_tools.py: drop profile schema field, function param, create/update plumbing, display field
  • cron/jobs.py: drop _normalize_profile(), the profile create param, stored field, and update validation
  • cron/scheduler.py: drop _job_profile_context() and the run_job wrapper (back to a single run_job), drop the script-runner env override, revert sequential partition to workdir-only
  • hermes_cli/cron.py + hermes_cli/subcommands/cron.py: drop --profile on cron create / cron edit and the Profile display lines
  • tests/: delete tests/cron/test_cron_profile.py, strip profile assertions from test_cron.py, fix stale comments
  • website/docs/user-guide/features/cron.md: remove the "Running cron jobs in a specific profile" section

Kept: the context-local HERMES_HOME override in hermes_constants.py and the subprocess bridging in tools/environments/local.py — they have other consumers now (dashboard multi-profile cron views, TUI gateway, copilot ACP client, code-exec tool).

Legacy jobs.json entries that still carry a profile key load fine; the field is simply ignored.

Validation

Before After
cronjob(profile=...) accepted TypeError (param gone)
Tool schema profile field removed
hermes cron create --profile accepted unrecognized argument
Scheduler sequential pass workdir OR profile workdir only
Legacy jobs.json with profile key n/a loads, field ignored

472 targeted tests pass (tests/cron/, tests/hermes_cli/test_cron.py, tests/test_subprocess_home_isolation.py, tests/tools/test_cronjob_tools.py). E2E verified with real imports against a temp HERMES_HOME.

Reverts #28124.

Infographic

cron-profile-revert

Fully removes the cron per-job 'profile' arg added in #28124: the
cronjob tool schema field, CLI --profile flags on cron create/edit,
job-record storage/validation, the scheduler's _job_profile_context
wrapper, and the script-runner env override. Sequential-partition
logic reverts to workdir-only.

The context-local HERMES_HOME override in hermes_constants and the
subprocess bridging in tools/environments/local.py are kept — they
now have other consumers (dashboard multi-profile, TUI gateway).
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: revert/cron-profile-28124 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10648 on HEAD, 10660 on base (✅ -12)

🆕 New issues (1):

Rule Count
invalid-assignment 1
First entries
gateway/platforms/api_server.py:707: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to `def create_job(prompt: str | None, schedule: str, name: str | None = None, repeat: int | None = None, deliver: str | None = None, origin: dict[str, Any] | None = None, skill: str | None = None, skills: list[str] | None = None, model: str | None = None, provider: str | None = None, base_url: str | None = None, script: str | None = None, context_from: str | list[str] | None = None, enabled_toolsets: list[str] | None = None, workdir: str | None = None, no_agent: bool = False) -> dict[str, Any]`

✅ Fixed issues (8):

Rule Count
invalid-argument-type 3
unresolved-import 2
unresolved-attribute 2
invalid-assignment 1
First entries
gateway/platforms/api_server.py:707: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to `def create_job(prompt: str | None, schedule: str, name: str | None = None, repeat: int | None = None, deliver: str | None = None, origin: dict[str, Any] | None = None, skill: str | None = None, skills: list[str] | None = None, model: str | None = None, provider: str | None = None, base_url: str | None = None, script: str | None = None, context_from: str | list[str] | None = None, enabled_toolsets: list[str] | None = None, workdir: str | None = None, profile: str | None = None, no_agent: bool = False) -> dict[str, Any]`
tests/cron/test_cron_profile.py:12: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/cron/test_cron_profile.py:152: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `Overload[(i: SupportsIndex, /) -> str, (s: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> list[str]]` cannot be called with key of type `Literal["profile"]` on object of type `list[str]`
tests/cron/test_cron_profile.py:152: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["profile"]` on object of type `str`
tests/cron/test_cron_profile.py:266: [unresolved-import] unresolved-import: Cannot resolve imported module `dotenv`
tests/cron/test_cron_profile.py:202: [unresolved-attribute] unresolved-attribute: Unresolved attribute `AIAgent` on type `ModuleType`
tests/cron/test_cron_profile.py:152: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["properties"]` on object of type `str`
tests/cron/test_cron_profile.py:153: [unresolved-attribute] unresolved-attribute: Attribute `lower` is not defined on `dict[str, str]`, `dict[str, dict[str, str]]`, `list[str]`, `bool` in union `Unknown | str | dict[str, str] | ... omitted 3 union elements`

Unchanged: 5560 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@teknium1 teknium1 merged commit 7d8d000 into main Jun 11, 2026
29 checks passed
@teknium1 teknium1 deleted the revert/cron-profile-28124 branch June 11, 2026 03:46
OutThisLife added a commit to xxxigm/hermes-agent that referenced this pull request Jun 11, 2026
…-two-html5-backends

Pick up cron profile revert (NousResearch#43956) so test shard 2 passes.
OutThisLife added a commit to xxxigm/hermes-agent that referenced this pull request Jun 11, 2026
Cron per-job profile support was reverted on main (NousResearch#43956) but
test_subcommands_cron still passed --profile work. Align the test
with the current argparse surface.
sitiouno added a commit to SiteOneTech/hermes-agent-original that referenced this pull request Jun 11, 2026
OutThisLife added a commit that referenced this pull request Jun 11, 2026
Per-job cron profile support was reverted in #43956 but the extracted
parser test still asserted --profile on create. Remove the stale flag
so test slice 1 passes on current main.
OutThisLife added a commit to xxxigm/hermes-agent that referenced this pull request Jun 11, 2026
Rename the fixture prompt so the test file blob is unambiguously
new after NousResearch#43956 removed cron --profile; main still carried the old
--profile assertion which broke slice 1 under the PR merge ref.
OutThisLife added a commit to xxxigm/hermes-agent that referenced this pull request Jun 11, 2026
Avoid slice-1 CI repeatedly executing a stale cached copy of
test_subcommands_cron.py (still asserting --profile after NousResearch#43956).
The merge-ref tree is correct; renaming forces a fresh module path.
OutThisLife added a commit that referenced this pull request Jun 11, 2026
Slice 1 kept executing a cached copy of test_subcommands_cron.py that
still asserted --profile after #43956 reverted per-job profile support,
even though the merge-ref tree was correct. Rename the module and refresh
the fixture prompt so CI collects the updated file.
OutThisLife added a commit that referenced this pull request Jun 11, 2026
Slice 1 kept executing a cached copy of test_subcommands_cron.py that
still asserted --profile after #43956 reverted per-job profile support,
even though the merge-ref tree was correct. Rename the module and refresh
the fixture prompt so CI collects the updated file.
AIalliAI pushed a commit to AIalliAI/Hermes that referenced this pull request Jun 11, 2026
Resolves conflicts in cron/jobs.py and cron/scheduler.py against the
per-job profile revert (NousResearch#43956): keeps the _jobs_file_lock CRUD locking,
the _EnvMutationGate cross-pool exclusion, and the gateway scheduler-owner
deferral from this branch, while dropping all per-job profile support to
match upstream.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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