Skip to content

Make Telegram conversation posture-aware - #11

Merged
acoastalfog merged 2 commits into
mainfrom
codex/conversation-commitment-postures
May 23, 2026
Merged

Make Telegram conversation posture-aware#11
acoastalfog merged 2 commits into
mainfrom
codex/conversation-commitment-postures

Conversation

@acoastalfog

Copy link
Copy Markdown
Owner

Summary

  • Adds posture-aware Telegram MCP tool filtering so ordinary chat keeps safe KB/world read tools while workflow/action/diagnostic tools stay gated behind explicit intent.
  • Makes KB workflow rendering and watcher/process notifications concise by default, with machinery reserved for action or diagnostic posture.
  • Documents the conversation-first Telegram behavior.

Validation

  • scripts/run_tests.sh tests/hermes_cli/test_tools_config.py tests/plugins/test_kb_journeys.py tests/gateway/test_background_process_notifications.py tests/gateway/test_display_config.py tests/tools/test_cronjob_tools.py
  • uv run --extra dev ruff check hermes_cli/tools_config.py model_tools.py gateway/run.py plugins/kb_journeys/__init__.py tests/hermes_cli/test_tools_config.py tests/plugins/test_kb_journeys.py tests/gateway/test_background_process_notifications.py
  • npm run build in web/
  • npm run build in website/

Notes

Website build succeeded with pre-existing Docusaurus broken-link warnings and a prebuild yaml import warning for skill extraction; these are not introduced by this PR.

Safety

No production deployment performed. Confirmed writes, publication, and external actions remain policy-gated.

Closes #7
Closes #8
Closes #9
Closes #10

@github-actions

github-actions Bot commented May 23, 2026

Copy link
Copy Markdown

🔎 Lint report: codex/conversation-commitment-postures 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: 8401 on HEAD, 8421 on base (✅ -20)

🆕 New issues (9):

Rule Count
invalid-argument-type 8
unresolved-attribute 1
First entries
run_agent.py:14031: [invalid-argument-type] invalid-argument-type: Argument to function `_is_oauth_token` is incorrect: Expected `str`, found `str | dict[Unknown, Unknown] | Any | ... omitted 4 union elements`
run_agent.py:2460: [invalid-argument-type] invalid-argument-type: Argument to function `query_ollama_num_ctx` is incorrect: Expected `str`, found `(str & ~AlwaysFalsy) | (dict[str, str] & ~AlwaysFalsy) | (Any & ~AlwaysFalsy) | ... omitted 5 union elements`
run_agent.py:14034: [invalid-argument-type] invalid-argument-type: Argument to function `len` is incorrect: Expected `Sized`, found `(str & ~AlwaysFalsy) | (dict[Unknown, Unknown] & ~AlwaysFalsy) | (Any & ~AlwaysFalsy) | ... omitted 4 union elements`
run_agent.py:7547: [invalid-argument-type] invalid-argument-type: Argument to function `_codex_cloudflare_headers` is incorrect: Expected `str`, found `Unknown | str | dict[str, str] | dict[Unknown, Unknown] | Divergent`
run_agent.py:2719: [invalid-argument-type] invalid-argument-type: Argument to function `_is_oauth_token` is incorrect: Expected `str`, found `(Unknown & ~AlwaysFalsy) | (str & ~AlwaysFalsy) | (dict[str, str] & ~AlwaysFalsy) | ... omitted 5 union elements`
run_agent.py:7736: [invalid-argument-type] invalid-argument-type: Argument to function `build_anthropic_client` is incorrect: Expected `str`, found `str | dict[Unknown, Unknown] | Any | ... omitted 4 union elements`
tests/agent/test_codex_cloudflare_headers.py:163: [unresolved-attribute] unresolved-attribute: Attribute `get` is not defined on `str & ~AlwaysFalsy` in union `(Unknown & ~AlwaysFalsy) | (str & ~AlwaysFalsy) | (dict[str, str] & ~AlwaysFalsy) | dict[Unknown, Unknown] | Divergent`
run_agent.py:2716: [invalid-argument-type] invalid-argument-type: Argument to function `build_anthropic_client` is incorrect: Expected `str`, found `(Unknown & ~AlwaysFalsy) | (str & ~AlwaysFalsy) | (dict[str, str] & ~AlwaysFalsy) | ... omitted 5 union elements`
run_agent.py:2767: [invalid-argument-type] invalid-argument-type: Argument to function `get_model_context_length` is incorrect: Expected `str`, found `str | dict[str, str] | Any | ... omitted 4 union elements`

✅ Fixed issues (15):

Rule Count
invalid-argument-type 8
unsupported-operator 3
unresolved-attribute 3
not-subscriptable 1
First entries
tests/agent/test_codex_cloudflare_headers.py:181: [unsupported-operator] unsupported-operator: Operator `in` is not supported between objects of type `Literal["originator"]` and `(Unknown & ~AlwaysFalsy) | (str & ~AlwaysFalsy) | (dict[str, str] & ~AlwaysFalsy) | ... omitted 3 union elements`
run_agent.py:14034: [invalid-argument-type] invalid-argument-type: Argument to function `len` is incorrect: Expected `Sized`, found `(str & ~AlwaysFalsy) | (dict[Unknown, Unknown] & ~AlwaysFalsy) | (Any & ~AlwaysFalsy) | ... omitted 3 union elements`
run_agent.py:2767: [invalid-argument-type] invalid-argument-type: Argument to function `get_model_context_length` is incorrect: Expected `str`, found `str | dict[str, str] | Any | ... omitted 3 union elements`
run_agent.py:7736: [invalid-argument-type] invalid-argument-type: Argument to function `build_anthropic_client` is incorrect: Expected `str`, found `str | dict[Unknown, Unknown] | Any | ... omitted 3 union elements`
run_agent.py:7547: [invalid-argument-type] invalid-argument-type: Argument to function `_codex_cloudflare_headers` is incorrect: Expected `str`, found `Unknown | str | dict[str, str] | ... omitted 3 union elements`
tests/agent/test_codex_cloudflare_headers.py:163: [unresolved-attribute] unresolved-attribute: Attribute `startswith` is not defined on `dict[str, str]` in union `Unknown | str | dict[str, str]`
tests/run_agent/test_provider_attribution_headers.py:222: [not-subscriptable] not-subscriptable: Cannot subscript object of type `int` with no `__getitem__` method
run_agent.py:14031: [invalid-argument-type] invalid-argument-type: Argument to function `_is_oauth_token` is incorrect: Expected `str`, found `str | dict[Unknown, Unknown] | Any | ... omitted 3 union elements`
run_agent.py:2719: [invalid-argument-type] invalid-argument-type: Argument to function `_is_oauth_token` is incorrect: Expected `str`, found `(Unknown & ~AlwaysFalsy) | (str & ~AlwaysFalsy) | (dict[str, str] & ~AlwaysFalsy) | ... omitted 4 union elements`
run_agent.py:2716: [invalid-argument-type] invalid-argument-type: Argument to function `build_anthropic_client` is incorrect: Expected `str`, found `(Unknown & ~AlwaysFalsy) | (str & ~AlwaysFalsy) | (dict[str, str] & ~AlwaysFalsy) | ... omitted 4 union elements`
run_agent.py:2460: [invalid-argument-type] invalid-argument-type: Argument to function `query_ollama_num_ctx` is incorrect: Expected `str`, found `(str & ~AlwaysFalsy) | (dict[str, str] & ~AlwaysFalsy) | (Any & ~AlwaysFalsy) | ... omitted 4 union elements`
tests/run_agent/test_provider_attribution_headers.py:224: [unsupported-operator] unsupported-operator: Operator `not in` is not supported between objects of type `Literal["X-OpenRouter-Cache-TTL"]` and `Unknown | str | dict[str, str] | ... omitted 3 union elements`
tests/run_agent/test_provider_attribution_headers.py:158: [unresolved-attribute] unresolved-attribute: Attribute `startswith` is not defined on `dict[str, str]` in union `Unknown | str | dict[str, str]`
tests/run_agent/test_provider_attribution_headers.py:223: [unsupported-operator] unsupported-operator: Operator `not in` is not supported between objects of type `Literal["X-OpenRouter-Cache"]` and `Unknown | str | dict[str, str] | ... omitted 3 union elements`
tests/agent/test_codex_cloudflare_headers.py:163: [unresolved-attribute] unresolved-attribute: Attribute `get` is not defined on `str & ~AlwaysFalsy`, `int & ~AlwaysFalsy` in union `(Unknown & ~AlwaysFalsy) | (str & ~AlwaysFalsy) | (dict[str, str] & ~AlwaysFalsy) | ... omitted 3 union elements`

Unchanged: 4398 pre-existing issues carried over.

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

@acoastalfog

Copy link
Copy Markdown
Owner Author

Follow-up CI blocker patch pushed in commit 3c277287c:

  • Updated acp_registry/agent.json to match pyproject.toml version 0.15.23.
  • Hardened systemd service PATH discovery so inaccessible calling-user paths such as /root/.hermes/node/bin do not raise while generating a target-user unit.
  • Updated xAI STT dotenv regression tests to patch the direct tools.xai_http.get_env_value resolver hook used by the credential path.

Focused validation after patch:

  • uv run --python 3.11 --extra dev python -m pytest tests/acp/test_registry_manifest.py::test_agent_json_version_matches_pyproject tests/acp/test_registry_manifest.py::test_agent_json_pins_uvx_package_to_pyproject_version tests/hermes_cli/test_gateway_service.py::TestSystemUnitHermesHome::test_system_unit_uses_target_user_home_not_calling_user tests/hermes_cli/test_gateway_service.py::TestSystemUnitHermesHome::test_system_unit_remaps_profile_to_target_user tests/tools/test_transcription_dotenv_fallback.py::TestProviderSelectionGate::test_explicit_xai_sees_dotenv tests/tools/test_transcription_dotenv_fallback.py::TestEndToEndRegressionGuard::test_xai_key_only_in_dotenv_before_fix -q --tb=short → 6 passed
  • uv run --extra dev ruff check acp_registry/agent.json hermes_cli/gateway.py tests/tools/test_transcription_dotenv_fallback.py → passed

CI has been retriggered by the push.

@acoastalfog
acoastalfog merged commit 06a8a58 into main May 23, 2026
17 checks passed
@acoastalfog
acoastalfog deleted the codex/conversation-commitment-postures branch May 23, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant