Skip to content

Conversation

@aldro61
Copy link
Collaborator

@aldro61 aldro61 commented Dec 6, 2025

Summary

Fixes #119 - Ensures that KnowledgeBaseSearchTask consistently uses the same ServiceNow instance throughout its lifecycle instead of potentially creating a different instance during knowledge base validation.

Changes

  • Changed src/browsergym/workarena/tasks/knowledge.py:84 to use self.instance instead of creating a new SNowInstance()
  • This ensures the instance passed to the task constructor is used consistently when checking knowledge base integrity

Problem

After migrating to a common instances pool, the check_knowledge_base call in KnowledgeBaseSearchTask.__init__ was creating a new SNowInstance() each time. Since SNowInstance() now randomly selects from a pool of instances, this could result in the knowledge base check running on a completely different instance than the one the task was initialized with.

Solution

Use self.instance (inherited from AbstractServiceNowTask) which is already set to the instance passed to the constructor or a default instance. This ensures consistency throughout the task execution.

Testing

Ran the task across all 8 instances in the pool with 8 parallel workers:

python run_atomic_task_matrix.py --task-id workarena.servicenow.knowledge-base-search --seed-count 1 --workers 8

Results: All 8 runs succeeded (8 success / 0 failed)

🤖 Generated with Claude Code

Resolves issue #119 where KnowledgeBaseSearchTask could use different
ServiceNow instances within the same task when checking knowledge base
integrity. Changed line 84 to use self.instance instead of creating a
new SNowInstance(), ensuring the same instance is used throughout the
task lifecycle.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@aldro61 aldro61 merged commit 6a6db2a into main Dec 6, 2025
4 of 7 checks passed
@aldro61 aldro61 deleted the fix-issue-119-instance-consistency branch December 6, 2025 18:04
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.

[Bug]: Different snow instances could be used in one task

2 participants