Repository navigation
Context Agent poller resilience PR - #267
Open
dberardo-com wants to merge 1 commit into
Open
dberardo-com wants to merge 1 commit into
dberardo-com wants to merge 1 commit into
Conversation
Refactor timeout handling and logging in main.py. Introduce positive_timeout function to read environment variables safely. Update polling intervals and error handling in background tasks. Signed-off-by: dberardo-com <65530457+dberardo-com@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DISCLAIMER: this is PR is vibe coded !!
Relates to #266
Summary
next_task()withCONTEXT_AGENT_CLAIM_TIMEOUT_SEC(default 60s)./trigger, with configurable idle fallbackCONTEXT_AGENT_IDLE_POLL_SEC(default 30s).without logging user prompts or task payloads.
Scope
Only
ex_app/lib/main.pyis needed for this source change.Do not include site-specific ConfigMap patches (
agent.py,context_chat.py,nc_model.py), credentials, or Kubernetes cleanup logic in the upstream PR.Verification
python -m py_compile ex_app/lib/main.pycontainment, supervisor restart, claim timeout/recovery, cancellation.
required; the isolated test is not equivalent to a full application test.
successful processing of a new task without pod restart. This does not prove
unpatched upstream would fail the same test.
Limitations
asyncio.wait_fordepends on cooperative cancellation and can leave aserver-side claimed task in RUNNING if the response is lost or arrives late.
is provided here.
handlers; this is safer than leaving the poller permanently dead but does
not guarantee recovery of in-progress tasks.
handle_task()is not forcibly timedout by the task-acquisition timeout.
it still generates Nextcloud API traffic.